Avoid adding custom toggler attributes when the feature flag is false.

This commit is contained in:
Paulo Reis 2018-10-19 10:34:07 +01:00
parent 4232732646
commit a957593b62
3 changed files with 9 additions and 8 deletions

View file

@ -67,9 +67,9 @@ block content
ng-hide="state.loading", ng-hide="state.loading",
resize-on="layout:chat:resize,history:toggle", resize-on="layout:chat:resize,history:toggle",
minimum-restore-size-west="130" minimum-restore-size-west="130"
custom-toggler-pane=hasFeature('custom-togglers') ? "'west'" : "false" custom-toggler-pane=hasFeature('custom-togglers') ? "west" : false
custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_filetree") : "" custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_filetree") : false
custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_filetree") : "" custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_filetree") : false
) )
.ui-layout-west .ui-layout-west
include ./editor/file-tree include ./editor/file-tree

View file

@ -8,9 +8,9 @@ div.full-size(
initial-size-east="'50%'" initial-size-east="'50%'"
minimum-restore-size-east="300" minimum-restore-size-east="300"
allow-overflow-on="'center'" allow-overflow-on="'center'"
custom-toggler-pane=hasFeature('custom-togglers') ? "'east'" : "false" custom-toggler-pane=hasFeature('custom-togglers') ? "east" : false
custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_pdf") : "" custom-toggler-msg-when-open=hasFeature('custom-togglers') ? translate("tooltip_hide_pdf") : false
custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_pdf") : "" custom-toggler-msg-when-closed=hasFeature('custom-togglers') ? translate("tooltip_show_pdf") : false
) )
.ui-layout-center( .ui-layout-center(
ng-controller="ReviewPanelController", ng-controller="ReviewPanelController",
@ -101,6 +101,7 @@ div.full-size(
ng-click="syncToCode()" ng-click="syncToCode()"
) )
i.synctex-control-icon i.synctex-control-icon
div.full-size( div.full-size(
ng-if="ui.pdfLayout == 'flat'" ng-if="ui.pdfLayout == 'flat'"
ng-show="ui.view == 'pdf'" ng-show="ui.view == 'pdf'"

View file

@ -8,10 +8,10 @@ define [
pre: (scope, element, attrs) -> pre: (scope, element, attrs) ->
name = attrs.layout name = attrs.layout
customTogglerPane = scope.$eval(attrs.customTogglerPane or "false") customTogglerPane = attrs.customTogglerPane
customTogglerMsgWhenOpen = attrs.customTogglerMsgWhenOpen customTogglerMsgWhenOpen = attrs.customTogglerMsgWhenOpen
customTogglerMsgWhenClosed = attrs.customTogglerMsgWhenClosed customTogglerMsgWhenClosed = attrs.customTogglerMsgWhenClosed
hasCustomToggler = customTogglerPane != false and customTogglerMsgWhenOpen != "" and customTogglerMsgWhenClosed != "" hasCustomToggler = customTogglerPane? and customTogglerMsgWhenOpen? and customTogglerMsgWhenClosed?
if attrs.spacingOpen? if attrs.spacingOpen?
spacingOpen = parseInt(attrs.spacingOpen, 10) spacingOpen = parseInt(attrs.spacingOpen, 10)