29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/netzke/plugins/configuration_tool.rb', line 29
def js_extend_properties_with_config_tool
js_extend_properties_without_config_tool.merge({
:gear => <<-END_OF_JAVASCRIPT.l
function(){
var w = new Ext.Window({
title:'Config - '+ this.dataClassName,
layout:'fit',
modal:true,
width: Ext.lib.Dom.getViewWidth() *0.9,
height: Ext.lib.Dom.getViewHeight() *0.9,
closeAction:'destroy',
buttons:[{
text:'OK',
disabled: !this.configurable,
tooltip: this.configurable ? null : "No dynamic configuration for this component",
handler:function(){
w.closeRes = 'OK';
w.close();
}
},{
text:'Cancel',
handler:function(){
w.closeRes = 'cancel';
w.close();
}
}]
});
w.show(null, function(){
this.loadAggregatee({id:"configuration_panel", container:w.id});
}, this);
w.on('close', function(){
if (w.closeRes == 'OK'){
var configurationPanel = this.getChildWidget('configuration_panel');
var panels = configurationPanel.getLoadedChildren();
var commitData = {};
Ext.each(panels, function(p){
if (p.getCommitData) {commitData[p.localId(configurationPanel)] = p.getCommitData();}
}, this);
configurationPanel.commit({commit_data:Ext.encode(commitData)});
}
}, this);
}
END_OF_JAVASCRIPT
})
end
|