Handle logout onClick handler for superuser button in filemanager file dialog

This commit is contained in:
Hadi Nategh
2014-07-31 17:45:57 +00:00
parent 3f2eddc0c7
commit 3021b6a3c9
2 changed files with 36 additions and 3 deletions

View File

@ -773,5 +773,32 @@ app.classes.filemanager = AppJS.extend(
event.preventDefault();
event.stopPropagation();
return false;
},
/**
* Set Sudo button's label and change its onclick handler according to its action
*
* @param {widget object} _widget sudo buttononly
* @param {string} _action string of action type {login|logout}
*/
set_sudoButton: function (_widget, _action)
{
var widget = _widget || this.et2.getWidgetById('sudouser');
if (widget)
{
switch (_action)
{
case 'login':
widget.set_label('Logout');
this.et2._inst.submit(widget);
break;
default:
widget.set_label('Superuser');
widget.onclick = function(){
jQuery('.superuser').css('display','inline');
}
}
}
}
});