|
@@ -245,17 +245,13 @@ $(function () {
|
|
|
});
|
|
|
});
|
|
|
|
|
|
-jQuery(document).ready(function () {
|
|
|
- var $ = jQuery;
|
|
|
- $('body').mousedown(function(e){
|
|
|
- if($(e.target).closest('[moe]').length || $(e.target).closest('#create-shortcut-form').length || $(e.target).is('#create-shortcut-form')){
|
|
|
- return;
|
|
|
+var initMoes = function() {
|
|
|
+ $('[moe]').each(function () {
|
|
|
+
|
|
|
+ if($(this).is('[initialized]')) { // skip to next moe
|
|
|
+ return true;
|
|
|
}
|
|
|
- $('[moe] form:not([show])').hide();
|
|
|
- hideMoeFormMask();
|
|
|
- });
|
|
|
|
|
|
- $('[moe]').each(function () {
|
|
|
var moe = $(this);
|
|
|
moe.isProcessing = false;
|
|
|
var info = moe.find('[info]')[0]; // OPTIONAL
|
|
@@ -266,6 +262,8 @@ jQuery(document).ready(function () {
|
|
|
var submit = moe.find('[submit]'); // REQUIRED
|
|
|
var cancel = moe.find('[cancel]')[0]; // OPTIONAL
|
|
|
|
|
|
+ // ajax load - OPTIONAL
|
|
|
+ var moeParent = $(form).closest('[moe-parent][url]');
|
|
|
|
|
|
if ($(this).attr('formOff') != null) {
|
|
|
$(form).find(':input').attr('disabled', true);
|
|
@@ -396,10 +394,18 @@ jQuery(document).ready(function () {
|
|
|
window.top.history.back();
|
|
|
} else {
|
|
|
if (redir.indexOf('[data]') > -1) {
|
|
|
- redir = redir.replace('[data]', data);
|
|
|
+ redir = redir.replace('[data]', data);
|
|
|
}
|
|
|
fastLoad(redir, true, false);
|
|
|
}
|
|
|
+ } else if (moeParent.length) {
|
|
|
+ showMask();
|
|
|
+ $.get(moeParent.attr('url'), function(_data) {
|
|
|
+ moeParent.html(_data);
|
|
|
+ hideMask();
|
|
|
+ hideMoeFormMask();
|
|
|
+ initMoes();
|
|
|
+ });
|
|
|
} else {
|
|
|
pageReload();
|
|
|
}
|
|
@@ -407,7 +413,23 @@ jQuery(document).ready(function () {
|
|
|
|
|
|
}, false);
|
|
|
});
|
|
|
+
|
|
|
+ moe.attr('initialized', 1); // mark as initialized
|
|
|
+
|
|
|
});
|
|
|
+}
|
|
|
+
|
|
|
+jQuery(document).ready(function () {
|
|
|
+ var $ = jQuery;
|
|
|
+ $('body').mousedown(function(e){
|
|
|
+ if($(e.target).closest('[moe]').length || $(e.target).closest('#create-shortcut-form').length || $(e.target).is('#create-shortcut-form')){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $('[moe] form:not([show])').hide();
|
|
|
+ hideMoeFormMask();
|
|
|
+ });
|
|
|
+
|
|
|
+ initMoes();
|
|
|
|
|
|
$('table[info] input').each(function () {
|
|
|
$(this).prop('readonly', true);
|