From 013dbc5c2d1fb2eae9488408f75ca37f94dab3c8 Mon Sep 17 00:00:00 2001 From: Colin Tucker Date: Sun, 21 May 2017 15:09:24 +1000 Subject: [PATCH] Fixed site tree number badge selector in JS --- admin/client/dist/js/bundle.js | 2 +- admin/client/src/entwine/NumberBadges.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index 749a5fc..9698b5a 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -1 +1 @@ -!function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/silverware/admin/client/dist/",e(e.s=6)}([function(t,e){t.exports=jQuery},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("silverware.numberbadges",function(t){t("div.ss-tabset").entwine({onmatch:function(){this._super();var e=this;if(this.attr("data-number-badges")){var n=t.parseJSON(this.attr("data-number-badges"));t.each(n,function(t,n){if(n){var a=e.findTab(t);a.length&&a.append(''+n+"")}})}},findTab:function(t){return this.find(this.getTabId(t))},getTabId:function(t){return"a#tab-"+t.replace(".","_")}}),t(".cms-tree li").entwine({updateBadge:function(e){if(this.find("span.status-number-badge").length){var n="#"+this.attr("id"),a=n+".status-number-badge a span.jstree-pageicon::before",i='content: "'+(e>0?e:"")+'";';t("head").append('")}}}),t("span.status-number-badge-value").entwine({onmatch:function(){if(this._super(),!this.data("updated")){var t=parseInt(this.attr("title"));this.closest("li").updateBadge(t),this.data("updated",!0)}}})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("ss",function(t){t("*[class*=class-]").entwine({onmatch:function(){this._super(),t(this).attr("class",t(this).attr("class").replace(/\\/g,"_"))}})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("ss.autocompletefield",function(t){t(".field.autocomplete input.text").entwine({onmatch:function(){this._super(),this.initField(),this.initClear()},onfocusin:function(){this.getValue()>=this.getMinLength()&&t(this).autocomplete("search")},initField:function(){var e=this;t(this).autocomplete({source:e.getSourceURL(),minLength:e.getMinLength(),delay:e.getDelay(),change:function(t,n){e.update(t,n)},select:function(t,n){e.update(t,n)}})},initClear:function(){var e=this;t(this).parent().find("a.clear").click(function(t){t.preventDefault(),e.clearValue()})},setValue:function(e){t(this).val(e)},getValue:function(){return t(this).val()},getSourceURL:function(){return t(this).attr("data-source-url")},getMinLength:function(){return t(this).attr("data-min-length")},isFreeTextAllowed:function(){return!!t(this).attr("data-free-text")},getDelay:function(){return t(this).attr("data-delay")},getEmptyValue:function(){return t(this).attr("data-empty-value")},getHiddenInput:function(){return t(this).parent().find(":hidden")},getValueWrapper:function(){return t(this).parent().find(".value-wrapper")},getValueElement:function(){return t(this).parent().find(".value-wrapper > .value")},update:function(t,e){var n=this.getValue();n&&(e.item?this.updateValue(e.item.value,e.item.label):this.isFreeTextAllowed()&&this.updateValue(n))},updateValue:function(t,e){e||(e=t),this.getHiddenInput().val()!==t&&(this.getHiddenInput().val(t),this.getValueElement().text(e),this.getValueWrapper().addClass("has-value"))},clearValue:function(){this.getHiddenInput().val(""),this.getValueElement().text(this.getEmptyValue()),this.getValueWrapper().removeClass("has-value")}})})},function(t,e){},,function(t,e,n){n(4),n(2),n(1),n(3)}]); \ No newline at end of file +!function(t){function e(a){if(n[a])return n[a].exports;var i=n[a]={i:a,l:!1,exports:{}};return t[a].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,a){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:a})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/silverware/admin/client/dist/",e(e.s=6)}([function(t,e){t.exports=jQuery},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("silverware.numberbadges",function(t){t("div.ss-tabset").entwine({onmatch:function(){this._super();var e=this;if(this.attr("data-number-badges")){var n=t.parseJSON(this.attr("data-number-badges"));t.each(n,function(t,n){if(n){var a=e.findTab(t);a.length&&a.append(''+n+"")}})}},findTab:function(t){return this.find(this.getTabId(t))},getTabId:function(t){return"a#tab-"+t.replace(".","_")}}),t(".cms-tree li").entwine({updateBadge:function(e){if(this.find("span.status-number-badge").length){var n="#"+this.attr("id"),a=n+".status-number-badge > a span.jstree-pageicon::before",i='content: "'+(e>0?e:"")+'";';t("head").append('")}}}),t("span.status-number-badge-value").entwine({onmatch:function(){if(this._super(),!this.data("updated")){var t=parseInt(this.attr("title"));this.closest("li").updateBadge(t),this.data("updated",!0)}}})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("ss",function(t){t("*[class*=class-]").entwine({onmatch:function(){this._super(),t(this).attr("class",t(this).attr("class").replace(/\\/g,"_"))}})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var a=n(0);n.n(a).a.entwine("ss.autocompletefield",function(t){t(".field.autocomplete input.text").entwine({onmatch:function(){this._super(),this.initField(),this.initClear()},onfocusin:function(){this.getValue()>=this.getMinLength()&&t(this).autocomplete("search")},initField:function(){var e=this;t(this).autocomplete({source:e.getSourceURL(),minLength:e.getMinLength(),delay:e.getDelay(),change:function(t,n){e.update(t,n)},select:function(t,n){e.update(t,n)}})},initClear:function(){var e=this;t(this).parent().find("a.clear").click(function(t){t.preventDefault(),e.clearValue()})},setValue:function(e){t(this).val(e)},getValue:function(){return t(this).val()},getSourceURL:function(){return t(this).attr("data-source-url")},getMinLength:function(){return t(this).attr("data-min-length")},isFreeTextAllowed:function(){return!!t(this).attr("data-free-text")},getDelay:function(){return t(this).attr("data-delay")},getEmptyValue:function(){return t(this).attr("data-empty-value")},getHiddenInput:function(){return t(this).parent().find(":hidden")},getValueWrapper:function(){return t(this).parent().find(".value-wrapper")},getValueElement:function(){return t(this).parent().find(".value-wrapper > .value")},update:function(t,e){var n=this.getValue();n&&(e.item?this.updateValue(e.item.value,e.item.label):this.isFreeTextAllowed()&&this.updateValue(n))},updateValue:function(t,e){e||(e=t),this.getHiddenInput().val()!==t&&(this.getHiddenInput().val(t),this.getValueElement().text(e),this.getValueWrapper().addClass("has-value"))},clearValue:function(){this.getHiddenInput().val(""),this.getValueElement().text(this.getEmptyValue()),this.getValueWrapper().removeClass("has-value")}})})},function(t,e){},,function(t,e,n){n(4),n(2),n(1),n(3)}]); \ No newline at end of file diff --git a/admin/client/src/entwine/NumberBadges.js b/admin/client/src/entwine/NumberBadges.js index bce1ddc..37f084e 100644 --- a/admin/client/src/entwine/NumberBadges.js +++ b/admin/client/src/entwine/NumberBadges.js @@ -59,7 +59,7 @@ $.entwine('silverware.numberbadges', function($) { var id = '#' + this.attr('id'); - var selector = id + '.status-number-badge a span.jstree-pageicon::before'; + var selector = id + '.status-number-badge > a span.jstree-pageicon::before'; var content = 'content: "' + (value > 0 ? value : '') + '";'; $('head').append('');