src/pyams_skin/resources/js/myams-container.min.js
changeset 456 c09f55f777fa
parent 436 4ee52103327c
child 486 48b7cea0d903
--- a/src/pyams_skin/resources/js/myams-container.min.js	Tue Oct 30 12:28:25 2018 +0100
+++ b/src/pyams_skin/resources/js/myams-container.min.js	Mon Nov 12 12:45:51 2018 +0100
@@ -1,1 +1,1 @@
-!function(a,t){var e=t.MyAMS,n=e;e.container={changeOrder:function(t,e){a('input[name="'+a(this).data("ams-input-name")+'"]',a(this)).val(e.join(";"))},deleteElement:function(){return function(){var t=a(this);e.skin.bigBox({title:n.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+n.i18n.DELETE_WARNING,status:"info",buttons:n.i18n.BTN_OK_CANCEL},function(a){if(a===n.i18n.BTN_OK){var s=t.parents("tr").first(),i=s.parents("table").first(),r=s.data("ams-location")||i.data("ams-location")||"";r&&(r+="/");var f=s.data("ams-delete-target")||i.data("ams-delete-target")||"delete-element.json",c=s.data("ams-element-name");e.ajax.post(r+f,{object_name:c},function(a,t){"success"===a.status?(i.hasClass("datatable")?i.dataTable().fnDeleteRow(s[0]):s.remove(),a.handle_json&&e.ajax.handleJSON(a)):e.ajax.handleJSON(a)})}})}},switchElementVisibility:function(){return function(){var t=a(this),e=t.parents("td").first(),s=t.parents("tr").first(),i=s.parents("table");a("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),n.ajax.post(i.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||i.data("ams-attribute-switcher")),{object_name:s.data("ams-element-name")},function(e,n){e.visible?a("i",t).attr("class","fa fa-fw fa-eye"):a("i",t).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var t=a(this),e=t.parents("td").first(),s=e.data("ams-switcher-attribute-name"),i=t.parents("tr").first(),r=i.parents("table");a("i",t).attr("class","fa fa-fw fa-spinner fa-pulse"),n.ajax.post(r.data("ams-location")+"/"+(e.data("ams-attribute-switcher")||r.data("ams-attribute-switcher")),{object_name:i.data("ams-element-name")},function(e,n){e[s]||e.on?a("i",t).attr("class",r.data("ams-"+s+"-icon-on")||"fa fa-fw fa-check-square-o"):a("i",t).attr("class",r.data("ams-"+s+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}}}}(jQuery,this);
+!function(i,a){var f=a.MyAMS,c=f;f.container={changeOrder:function(a,t){i('input[name="'+i(this).data("ams-input-name")+'"]',i(this)).val(t.join(";"))},deleteElement:function(){return function(){var r=i(this);f.skin.bigBox({title:c.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+c.i18n.DELETE_WARNING,status:"info",buttons:c.i18n.BTN_OK_CANCEL},function(a){if(a===c.i18n.BTN_OK){var e=r.parents("tr").first(),n=e.parents("table").first(),t=e.data("ams-location")||n.data("ams-location")||"";t&&(t+="/");var s=e.data("ams-delete-target")||n.data("ams-delete-target")||"delete-element.json",i=e.data("ams-element-name");f.ajax.post(t+s,{object_name:i},function(a,t){"success"===a.status?(n.hasClass("datatable")?n.dataTable().fnDeleteRow(e[0]):e.remove(),a.handle_json&&f.ajax.handleJSON(a)):f.ajax.handleJSON(a)})}})}},switchElementVisibility:function(){return function(){var e=i(this),a=e.parents("td").first(),t=e.parents("tr").first(),n=t.parents("table");i("i",e).attr("class","fa fa-fw fa-spinner fa-pulse"),c.ajax.post(n.data("ams-location")+"/"+(a.data("ams-attribute-switcher")||n.data("ams-attribute-switcher")),{object_name:t.data("ams-element-name")},function(a,t){a.visible?i("i",e).attr("class","fa fa-fw fa-eye"):i("i",e).attr("class","fa fa-fw fa-eye-slash text-danger")})}},switchElementAttribute:function(){return function(){var e=i(this),a=e.parents("td").first(),n=a.data("ams-switcher-attribute-name"),t=e.parents("tr").first(),s=t.parents("table");i("i",e).attr("class","fa fa-fw fa-spinner fa-pulse"),c.ajax.post(s.data("ams-location")+"/"+(a.data("ams-attribute-switcher")||s.data("ams-attribute-switcher")),{object_name:t.data("ams-element-name")},function(a,t){a[n]||a.on?i("i",e).attr("class",s.data("ams-"+n+"-icon-on")||"fa fa-fw fa-check-square-o"):i("i",e).attr("class",s.data("ams-"+n+"-icon-off")||"fa fa-fw fa-check-square txt-color-silver opacity-75")})}}}}(jQuery,this);