var myslice = {
user: {},
- user: function() {
+ get_user: function() {
if ($.isEmptyObject(this.user)) {
//this.login(function() { return this.user; });
if(localStorage.getItem('user')!='undefined'){
},
projects: {},
- projects: function() {
+ get_projects: function() {
if ($.isEmptyObject(this.projects)) {
//this.login(function() { return this.user; });
if(localStorage.getItem('projects')!='undefined'){
// What are the projects under this authority?
$.post("/rest/myslice:authority/",{'fields':['authority_hrn'],'filters':{'authority_hrn':'CONTAINS'+auth}}, function( data ) {
$.each(data, function(idx, project) {
- console.log(project.authority_hrn);
if($.inArray(project.authority_hrn,projects) == -1){
projects.push(project.authority_hrn);
}
if(isFunction(fn)){
fn();
}
+ }else{
+ $('#credentials_msg').css('display','block');
}
});
}else{
+ $('#credentials_msg').css('display','block');
if(isFunction(fn)){
fn();
}
}
-
},