[BUGFIX] Use numbers for „Show hidden content elements“ 57/56357/2
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Sun, 18 Mar 2018 14:12:38 +0000 (15:12 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sun, 18 Mar 2018 16:07:46 +0000 (17:07 +0100)
Resolves: #84469
Related: #82601
Releases: master
Change-Id: I65d1826e97584c43640ed248244c00f6608fb0a7
Reviewed-on: https://review.typo3.org/56357
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Guido Schmechel <littlegee@web.de>
Tested-by: Guido Schmechel <littlegee@web.de>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/backend/Resources/Private/TypeScript/PageActions.ts
typo3/sysext/backend/Resources/Public/JavaScript/PageActions.js

index 027879d..8cfb5c9 100644 (file)
@@ -123,7 +123,7 @@ class PageActions {
       $hiddenElements.slideUp();
     }
 
-    PersistentStorage.set('moduleData.web_layout.tt_content_showHidden', String($me.prop('checked'))).done((): void => {
+    PersistentStorage.set('moduleData.web_layout.tt_content_showHidden', $me.prop('checked') ? '1' : '0').done((): void => {
       $spinner.remove();
       $me.show();
     });
index f1e03ab..7a3d7dc 100644 (file)
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-define(["require","exports","./Enum/KeyTypes","jquery","./Storage/Persistent","./Wizard/NewContentElement"],function(t,e,n,i,a,o){"use strict";var s,c;return(c=s||(s={})).pageTitle=".t3js-title-inlineedit",c.hiddenElements=".t3js-hidden-record",c.newButton=".t3js-toggle-new-content-element-wizard",new(function(){function e(){var t=this;this.pageId=0,this.pageOverlayId=0,this.$pageTitle=null,this.$showHiddenElementsCheckbox=null,i(function(){t.initializeElements(),t.initializeEvents(),t.initializeNewContentElementWizard(),t.initializePageTitleRenaming()})}return e.prototype.setPageId=function(t){this.pageId=t},e.prototype.setLanguageOverlayId=function(t){this.pageOverlayId=t},e.prototype.initializePageTitleRenaming=function(){var t=this;if(i.isReady){if(!(this.pageId<=0)){var e=i('<a class="hidden" href="#" data-action="edit"><span class="t3-icon fa fa-pencil"></span></a>');e.on("click",function(e){e.preventDefault(),t.editPageTitle()}),this.$pageTitle.on("dblclick",function(){t.editPageTitle()}).on("mouseover",function(){e.removeClass("hidden")}).on("mouseout",function(){e.addClass("hidden")}).append(e)}}else i(function(){t.initializePageTitleRenaming()})},e.prototype.initializeElements=function(){this.$pageTitle=i(s.pageTitle+":first"),this.$showHiddenElementsCheckbox=i("#checkTt_content_showHidden")},e.prototype.initializeEvents=function(){this.$showHiddenElementsCheckbox.on("change",this.toggleContentElementVisibility)},e.prototype.toggleContentElementVisibility=function(t){var e=i(t.currentTarget),n=i(s.hiddenElements),o=i("<span />",{class:"checkbox-spinner fa fa-circle-o-notch fa-spin"});e.hide().after(o),e.prop("checked")?n.slideDown():n.slideUp(),a.set("moduleData.web_layout.tt_content_showHidden",String(e.prop("checked"))).done(function(){o.remove(),e.show()})},e.prototype.editPageTitle=function(){var t=this,e=i('<form><div class="form-group"><div class="input-group input-group-lg"><input class="form-control"><span class="input-group-btn"><button class="btn btn-default" type="button" data-action="submit"><span class="t3-icon fa fa-floppy-o"></span></button> </span><span class="input-group-btn"><button class="btn btn-default" type="button" data-action="cancel"><span class="t3-icon fa fa-times"></span></button> </span></div></div></form>'),a=e.find("input");e.find("[data-action=cancel]").on("click",function(){e.replaceWith(t.$pageTitle),t.initializePageTitleRenaming()}),e.find("[data-action=submit]").on("click",function(){var n=i.trim(a.val());""!==n&&t.$pageTitle.text()!==n?t.saveChanges(a):e.find("[data-action=cancel]").trigger("click")}),a.parents("form").on("submit",function(t){return t.preventDefault(),!1});var o=this.$pageTitle;o.children().last().remove(),o.replaceWith(e),a.val(o.text()).focus(),a.on("keyup",function(t){switch(t.which){case n.KeyTypesEnum.ENTER:e.find('[data-action="submit"]').trigger("click");break;case n.KeyTypesEnum.ESCAPE:e.find('[data-action="cancel"]').trigger("click")}})},e.prototype.saveChanges=function(e){var n=this,i=e.parents("form");i.find("button").addClass("disabled"),e.attr("disabled","disabled");var a,o={};a=this.pageOverlayId>0?this.pageOverlayId:this.pageId,o.data={},o.data.pages={},o.data.pages[a]={title:e.val()},t(["TYPO3/CMS/Backend/AjaxDataHandler"],function(t){t.process(o).done(function(){i.find("[data-action=cancel]").trigger("click"),n.$pageTitle.text(e.val()),n.initializePageTitleRenaming(),top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree()}).fail(function(){i.find("[data-action=cancel]").trigger("click")})})},e.prototype.initializeNewContentElementWizard=function(){i(s.newButton).click(function(t){var e=i(t.currentTarget);o.wizard(e.data("url"),e.data("title"))})},e}())});
\ No newline at end of file
+define(["require","exports","./Enum/KeyTypes","jquery","./Storage/Persistent","./Wizard/NewContentElement"],function(t,e,n,i,a,o){"use strict";var s,c;return(c=s||(s={})).pageTitle=".t3js-title-inlineedit",c.hiddenElements=".t3js-hidden-record",c.newButton=".t3js-toggle-new-content-element-wizard",new(function(){function e(){var t=this;this.pageId=0,this.pageOverlayId=0,this.$pageTitle=null,this.$showHiddenElementsCheckbox=null,i(function(){t.initializeElements(),t.initializeEvents(),t.initializeNewContentElementWizard(),t.initializePageTitleRenaming()})}return e.prototype.setPageId=function(t){this.pageId=t},e.prototype.setLanguageOverlayId=function(t){this.pageOverlayId=t},e.prototype.initializePageTitleRenaming=function(){var t=this;if(i.isReady){if(!(this.pageId<=0)){var e=i('<a class="hidden" href="#" data-action="edit"><span class="t3-icon fa fa-pencil"></span></a>');e.on("click",function(e){e.preventDefault(),t.editPageTitle()}),this.$pageTitle.on("dblclick",function(){t.editPageTitle()}).on("mouseover",function(){e.removeClass("hidden")}).on("mouseout",function(){e.addClass("hidden")}).append(e)}}else i(function(){t.initializePageTitleRenaming()})},e.prototype.initializeElements=function(){this.$pageTitle=i(s.pageTitle+":first"),this.$showHiddenElementsCheckbox=i("#checkTt_content_showHidden")},e.prototype.initializeEvents=function(){this.$showHiddenElementsCheckbox.on("change",this.toggleContentElementVisibility)},e.prototype.toggleContentElementVisibility=function(t){var e=i(t.currentTarget),n=i(s.hiddenElements),o=i("<span />",{class:"checkbox-spinner fa fa-circle-o-notch fa-spin"});e.hide().after(o),e.prop("checked")?n.slideDown():n.slideUp(),a.set("moduleData.web_layout.tt_content_showHidden",e.prop("checked")?"1":"0").done(function(){o.remove(),e.show()})},e.prototype.editPageTitle=function(){var t=this,e=i('<form><div class="form-group"><div class="input-group input-group-lg"><input class="form-control"><span class="input-group-btn"><button class="btn btn-default" type="button" data-action="submit"><span class="t3-icon fa fa-floppy-o"></span></button> </span><span class="input-group-btn"><button class="btn btn-default" type="button" data-action="cancel"><span class="t3-icon fa fa-times"></span></button> </span></div></div></form>'),a=e.find("input");e.find("[data-action=cancel]").on("click",function(){e.replaceWith(t.$pageTitle),t.initializePageTitleRenaming()}),e.find("[data-action=submit]").on("click",function(){var n=i.trim(a.val());""!==n&&t.$pageTitle.text()!==n?t.saveChanges(a):e.find("[data-action=cancel]").trigger("click")}),a.parents("form").on("submit",function(t){return t.preventDefault(),!1});var o=this.$pageTitle;o.children().last().remove(),o.replaceWith(e),a.val(o.text()).focus(),a.on("keyup",function(t){switch(t.which){case n.KeyTypesEnum.ENTER:e.find('[data-action="submit"]').trigger("click");break;case n.KeyTypesEnum.ESCAPE:e.find('[data-action="cancel"]').trigger("click")}})},e.prototype.saveChanges=function(e){var n=this,i=e.parents("form");i.find("button").addClass("disabled"),e.attr("disabled","disabled");var a,o={};a=this.pageOverlayId>0?this.pageOverlayId:this.pageId,o.data={},o.data.pages={},o.data.pages[a]={title:e.val()},t(["TYPO3/CMS/Backend/AjaxDataHandler"],function(t){t.process(o).done(function(){i.find("[data-action=cancel]").trigger("click"),n.$pageTitle.text(e.val()),n.initializePageTitleRenaming(),top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree()}).fail(function(){i.find("[data-action=cancel]").trigger("click")})})},e.prototype.initializeNewContentElementWizard=function(){i(s.newButton).click(function(t){var e=i(t.currentTarget);o.wizard(e.data("url"),e.data("title"))})},e}())});
\ No newline at end of file