Skip to content

Instantly share code, notes, and snippets.

@a-ignatov-parc
Created February 8, 2012 12:05
Show Gist options
  • Save a-ignatov-parc/1768561 to your computer and use it in GitHub Desktop.
Save a-ignatov-parc/1768561 to your computer and use it in GitHub Desktop.
checkData: function(route) {
var user = Calc.get('User').model;
if (user && user.get('isLoged')) {
return YES;
} else if (this.processWrongRoute && typeof(this.processWrongRoute) === 'function') {
this.processWrongRoute();
}
return NO;
},
edit: function() {
var name = 'edit',
location = [name];
if (Calc.baseLocation && this.checkData(name)) {
Calc
.navigate(location.join('/'))
.render('Calculator', {
editCurrentPolicy: YES
});
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment