src/pyams_skin/resources/js/myams-container.min.js
changeset 489 63ea9a94bd47
parent 486 48b7cea0d903
child 494 6ca0da3caede
--- a/src/pyams_skin/resources/js/myams-container.min.js	Wed Dec 12 21:16:29 2018 +0100
+++ b/src/pyams_skin/resources/js/myams-container.min.js	Thu Dec 13 14:28:29 2018 +0100
@@ -1,1 +1,1 @@
-!function(a,t){var e=t.MyAMS;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:e.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+e.i18n.DELETE_WARNING,status:"info",buttons:e.i18n.BTN_OK_CANCEL},function(a){if(a===e.i18n.BTN_OK){var n=t.parents("tr").first(),s=n.parents("table").first(),i=n.data("ams-location")||s.data("ams-location")||"";i&&(i+="/");var r=n.data("ams-delete-target")||s.data("ams-delete-target")||"delete-element.json",f=n.data("ams-element-name");e.ajax.post(i+r,{object_name:f},function(a,t){"success"===a.status?(s.hasClass("datatable")?s.dataTable().fnDeleteRow(n[0]):n.remove(),a.handle_json&&e.ajax.handleJSON(a)):e.ajax.handleJSON(a)})}})}},switchElementVisibility:function(){return function(){var t=a(this),n=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"),e.ajax.post(i.data("ams-location")+"/"+(n.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),n=t.parents("td").first(),s=n.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"),e.ajax.post(r.data("ams-location")+"/"+(n.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(a,t){var e=t.MyAMS;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&&e.skin.bigBox({title:e.i18n.WARNING,content:'<i class="text-danger fa fa-fw fa-bell"></i>&nbsp; '+e.i18n.DELETE_WARNING,status:"info",buttons:e.i18n.BTN_OK_CANCEL},function(a){if(a===e.i18n.BTN_OK){var n=t.parents("tr").first(),s=n.parents("table").first(),i=n.data("ams-location")||s.data("ams-location")||"";i&&(i+="/");var r=n.data("ams-delete-target")||s.data("ams-delete-target")||"delete-element.json",f=n.data("ams-element-name");e.ajax&&e.ajax.post(i+r,{object_name:f},function(a,t){"success"===a.status?(s.hasClass("datatable")?s.dataTable().fnDeleteRow(n[0]):n.remove(),a.handle_json&&e.ajax&&e.ajax.handleJSON(a)):e.ajax&&e.ajax.handleJSON(a)})}})}},switchElementVisibility:function(){return function(){var t=a(this),n=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"),e.ajax&&e.ajax.post(i.data("ams-location")+"/"+(n.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),n=t.parents("td").first(),s=n.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"),e.ajax&&e.ajax.post(r.data("ams-location")+"/"+(n.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);