Updated Lightbox script
authorThierry Florac <tflorac@ulthar.net>
Fri, 04 Jan 2019 09:00:28 +0100
changeset 333 02a2c1a4bb6e
parent 332 26af016d89c9
child 334 4b8a1c00ff0f
Updated Lightbox script
src/pyams_default_theme/resources/js/pyams-default.js
src/pyams_default_theme/resources/js/pyams-default.min.js
--- a/src/pyams_default_theme/resources/js/pyams-default.js	Thu Jan 03 23:09:35 2019 +0100
+++ b/src/pyams_default_theme/resources/js/pyams-default.js	Fri Jan 04 09:00:28 2019 +0100
@@ -75,12 +75,11 @@
 										description = element.data('description'),
 										modal = this.modal(),
 										container = $('.ekko-lightbox-container', modal);
+									$('.description', container).remove();
 									if (description) {
 										$('<div></div>').addClass('description')
 														.text(description)
 														.appendTo(container);
-									} else {
-										$('.description', container).remove();
 									}
 								}
 							});
--- a/src/pyams_default_theme/resources/js/pyams-default.min.js	Thu Jan 03 23:09:35 2019 +0100
+++ b/src/pyams_default_theme/resources/js/pyams-default.min.js	Fri Jan 04 09:00:28 2019 +0100
@@ -1,1 +1,1 @@
-!function(a,t){"use strict";var e=t.MyAMS;t.PyAMS_default={search:{updateSort:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).val();a('input[name="order_by"]',t).val(e),t.submit()}},updatePageLength:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).val();a('input[name="start"]',t).val(0),a('input[name="length"]',t).val(e),t.submit()}},previousPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).parents("ol.pagination").data("ams-current-page"),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*(e-2)),t.submit()}},nextPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).parents("ol.pagination").data("ams-current-page"),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*e),t.submit()}},gotoPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=parseInt(a(this).text()),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*(e-1)),t.submit()}}}},a(document).on("click",'[data-toggle="lightbox"]',function(t){t.preventDefault();var n=a(this);e.ajax.check(a.fn.ekkoLightbox,"/--static--/pyams_default_theme/js/ext/ekko-lightbox"+e.devext+".js",function(){n.ekkoLightbox({wrapping:!1,alwaysShowClose:!0,onContentLoaded:function(){var t=this.element().data("description"),e=this.modal(),n=a(".ekko-lightbox-container",e);t?a("<div></div>").addClass("description").text(t).appendTo(n):a(".description",n).remove()}})})}),a(document).on("click","[data-ams-click-handler]",function(t){var n=a(this),i=n.data("ams-disabled-handlers");if(!0!==i&&"click"!==i&&"all"!==i){var s=n.data();if(s.amsClickHandler){!0!==s.amsStopPropagation&&!0!==s.amsClickStopPropagation||t.stopPropagation(),!0!==s.amsClickKeepDefault&&t.preventDefault();for(var r=s.amsClickHandler.split(/\s+/),o=0;o<r.length;o++){var l=e.getFunctionByName(r[o]);void 0!==l&&l.call(n,t,s.amsClickHandlerOptions)}}}}),a(document).on("change","[data-ams-change-handler]",function(t){var n=a(this);if(!n.prop("readonly")){var i=n.data("ams-disabled-handlers");if(!0!==i&&"change"!==i&&"all"!==i){var s=n.data();if(s.amsChangeHandler){!0!==s.amsStopPropagation&&!0!==s.amsChangeStopPropagation||t.stopPropagation(),!0!==s.amsChangeKeepDefault&&t.preventDefault();for(var r=s.amsChangeHandler.split(/\s+/),o=0;o<r.length;o++){var l=e.getFunctionByName(r[o]);void 0!==l&&l.call(n,t,s.amsChangeHandlerOptions)}}}}});var n=function(){var t=a(".modal >div");t.exists()&&e.dialog.close(t),e.dialog.open("/get-glossary-term.html?term="+a(this).text(),{},{shown:function(){a(".thesaurus-term").off("click").on("click",n)}})};e.require(["error","ajax","dialog"],function(){a(".thesaurus-term").off("click").on("click",n)})}(jQuery,this);
+!function(a,t){"use strict";var e=t.MyAMS;t.PyAMS_default={search:{updateSort:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).val();a('input[name="order_by"]',t).val(e),t.submit()}},updatePageLength:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).val();a('input[name="start"]',t).val(0),a('input[name="length"]',t).val(e),t.submit()}},previousPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).parents("ol.pagination").data("ams-current-page"),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*(e-2)),t.submit()}},nextPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=a(this).parents("ol.pagination").data("ams-current-page"),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*e),t.submit()}},gotoPage:function(){var t=a('form[id="search-results"]');if(t.exists()){var e=parseInt(a(this).text()),n=a('input[name="length"]',t).val();a('input[name="start"]',t).val(n*(e-1)),t.submit()}}}},a(document).on("click",'[data-toggle="lightbox"]',function(t){t.preventDefault();var n=a(this);e.ajax.check(a.fn.ekkoLightbox,"/--static--/pyams_default_theme/js/ext/ekko-lightbox"+e.devext+".js",function(){n.ekkoLightbox({wrapping:!1,alwaysShowClose:!0,onContentLoaded:function(){var t=this.element().data("description"),e=this.modal(),n=a(".ekko-lightbox-container",e);a(".description",n).remove(),t&&a("<div></div>").addClass("description").text(t).appendTo(n)}})})}),a(document).on("click","[data-ams-click-handler]",function(t){var n=a(this),i=n.data("ams-disabled-handlers");if(!0!==i&&"click"!==i&&"all"!==i){var s=n.data();if(s.amsClickHandler){!0!==s.amsStopPropagation&&!0!==s.amsClickStopPropagation||t.stopPropagation(),!0!==s.amsClickKeepDefault&&t.preventDefault();for(var r=s.amsClickHandler.split(/\s+/),o=0;o<r.length;o++){var l=e.getFunctionByName(r[o]);void 0!==l&&l.call(n,t,s.amsClickHandlerOptions)}}}}),a(document).on("change","[data-ams-change-handler]",function(t){var n=a(this);if(!n.prop("readonly")){var i=n.data("ams-disabled-handlers");if(!0!==i&&"change"!==i&&"all"!==i){var s=n.data();if(s.amsChangeHandler){!0!==s.amsStopPropagation&&!0!==s.amsChangeStopPropagation||t.stopPropagation(),!0!==s.amsChangeKeepDefault&&t.preventDefault();for(var r=s.amsChangeHandler.split(/\s+/),o=0;o<r.length;o++){var l=e.getFunctionByName(r[o]);void 0!==l&&l.call(n,t,s.amsChangeHandlerOptions)}}}}});var n=function(){var t=a(".modal >div");t.exists()&&e.dialog.close(t),e.dialog.open("/get-glossary-term.html?term="+a(this).text(),{},{shown:function(){a(".thesaurus-term").off("click").on("click",n)}})};e.require(["error","ajax","dialog"],function(){a(".thesaurus-term").off("click").on("click",n)})}(jQuery,this);