widget module

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9031 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-05 10:01:33 +00:00
parent 249ba8c7f5
commit 2a8c16d4f9
13 changed files with 550 additions and 557 deletions

View file

@ -23,6 +23,8 @@ xe.ModuleListManager = xe.createApp("ModuleListManager", {
.bind('show', function(){
$(this).nextAll().show();
});
this.cast('MODULELIST_SYNC');
},
API_MODULELIST_ADD: function(){
@ -54,6 +56,24 @@ xe.ModuleListManager = xe.createApp("ModuleListManager", {
this.refreshValue();
},
API_MODULELIST_SYNC: function(){
var values = this.$keyObj.val();
if (!values) return;
var self = this;
function on_complete(data){
if (data.error) return;
for(var i in data.module_list){
var module = data.module_list[i];
var obj = $(document.createElement('option'));
obj.val(module.module_srl).html(module.browser_title+' ('+module.module_name+')').appendTo(self.$selectedObj);
}
}
$.exec_json('module.getModuleAdminModuleList', {'module_srls': values}, on_complete);
},
removeDuplicated : function() {
var selected = {};
this.$selectedObj.find('>option').each(function(){