js / index.html update set

This commit is contained in:
Dima Malishev 2011-09-10 02:10:49 +03:00
parent 6ceecb886e
commit 8155d2cd9c
5 changed files with 55 additions and 27 deletions

View file

@ -89,16 +89,20 @@ App.Actions.save_form = function(evt) {
// do_action_edit
App.Actions.edit = function(evt) {
var elm = $(evt.target);
elm = elm.hasClass('row') ? elm : elm.parents('.row');
var options = elm.find('.source').val();
var build_method = App.Env.getWorldName() + '_form';
var tpl = App.HTML.Build[build_method](options);
elm.replaceWith(tpl);
App.Helpers.disbleNotEditable();
//App.Helpers.updateScreen();
if ('undefined' != typeof App.Pages[App.Env.world].edit) {
App.Pages[App.Env.world].edit(evt);
} else {
var elm = $(evt.target);
elm = elm.hasClass('row') ? elm : elm.parents('.row');
var options = elm.find('.source').val();
var build_method = App.Env.getWorldName() + '_form';
var tpl = App.HTML.Build[build_method](options);
elm.replaceWith(tpl);
App.Helpers.disbleNotEditable();
//App.Helpers.updateScreen();
}
}
// do_cancel_form
@ -334,3 +338,16 @@ App.Actions.view_full_ns_list = function(evt)
var elm = $(evt.target);
App.Helpers.openInnerPopup(elm, $(elm).parents('.prop-box').find('.ns-full-list:first').html());
}
App.Actions.view_template_info = function(evt)
{
var elm = $(evt.target);
ref = elm.hasClass('row') ? elm : elm.parents('.row');
var options = ref.find('.source').val();
App.Ajax.request('DNS.getTemplateInfo', {spell: options}, function(reply) {
if (reply.result) {
App.Helpers.openInnerPopup(elm, reply.data);
}
});
}