fix for the new label window on translations tool,

This commit is contained in:
Erik Amaru Ortiz
2011-03-10 16:00:04 +00:00
parent e29dfb6ca9
commit c8529214e6

View File

@@ -1,4 +1,4 @@
var win; var newLabelWin;
Ext.onReady(function(){ Ext.onReady(function(){
Ext.QuickTips.init(); Ext.QuickTips.init();
@@ -85,7 +85,11 @@ Ext.onReady(function(){
{ {
text:_('ID_ADD'), text:_('ID_ADD'),
iconCls: 'button_menu_ext ss_sprite ss_add', iconCls: 'button_menu_ext ss_sprite ss_add',
handler: newLabel handler: function(){
Ext.getCmp('id').setValue('');
Ext.getCmp('label').setValue('');
newLabelWin.show();
}
},{ },{
text:_('ID_REMOVE'), text:_('ID_REMOVE'),
iconCls: 'button_menu_ext ss_sprite ss_delete', iconCls: 'button_menu_ext ss_sprite ss_delete',
@@ -210,50 +214,45 @@ var edit = function(){
}); });
} }
function newLabel() var frm = new Ext.FormPanel( {
{ id: 'formNew',
var frm = new Ext.FormPanel( { labelAlign : 'right',
id: 'formNew', labelWidth : 100,
labelAlign : 'right', width : 400,
labelWidth : 100, items : [ {
width : 400, id: 'id',
items : [ { fieldLabel: 'ID',
id: 'id', xtype:'textfield',
fieldLabel: 'ID', width: 350
xtype:'textfield', }, {
width: 350 id: 'label',
}, { fieldLabel: 'Label',
id: 'label', xtype:'textarea',
fieldLabel: 'Label', width: 350,
xtype:'textarea', height: 50
width: 350, }
height: 50 ],
} buttons : [{
], text : _('ID_SAVE'),
buttons : [{ handler : saveNew
text : _('ID_SAVE'), },{
handler : saveNew text : _('ID_CANCEL'),
},{ handler : function() {
text : _('ID_CANCEL'), newLabelWin.hide();
handler : function() { }
win.close(); }]
} });
}]
});
win = new Ext.Window({ newLabelWin = new Ext.Window({
//id: 'winNew', title: 'New Translation',
title: _('ID_NEW'), layout:'fit',
width: 490, title: _('ID_NEW'),
height: 150, width: 490,
layout:'fit', height: 150,
autoScroll:true, closeAction:'hide',
modal: true, plain: true,
maximizable: false, items: [frm]
items: [frm] });
});
win.show();
}
function doSearch(){ function doSearch(){
var filter = Ext.getCmp('searchTxt').getValue(); var filter = Ext.getCmp('searchTxt').getValue();
@@ -275,7 +274,7 @@ function saveNew()
success : function(obj, resp) { success : function(obj, resp) {
Ext.getCmp('grid').store.reload(); Ext.getCmp('grid').store.reload();
PMExt.notify('SAVE', resp.result.msg); PMExt.notify('SAVE', resp.result.msg);
win.hide(); newLabelWin.hide();
}, },
failure: function(obj, resp) { failure: function(obj, resp) {
Ext.Msg.alert( _('ID_ERROR'), resp.result.msg); Ext.Msg.alert( _('ID_ERROR'), resp.result.msg);