From bfaf98be53d28a2c288c28e9cf371ece9355e092 Mon Sep 17 00:00:00 2001 From: Cezar Augusto Date: Fri, 21 Oct 2016 14:36:25 -0200 Subject: [PATCH] Disable option to add a bookmark without location and a folder without a title. Fix #5010 Auditors: @bsclifton Test Plan: 1) Add a bookmark 2) Edit bookmark removing its location 3) "Done" button should be disabled and: 1) Add a bookmark folder 2) Remove folder's title 3) "Done" button should be disabled --- js/components/addEditBookmark.js | 5 +++-- less/button.less | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/js/components/addEditBookmark.js b/js/components/addEditBookmark.js index 8661408a66d..150dc6b5c53 100644 --- a/js/components/addEditBookmark.js +++ b/js/components/addEditBookmark.js @@ -36,8 +36,9 @@ class AddEditBookmark extends ImmutableComponent { const title = this.props.currentDetail.get('title') || this.props.currentDetail.get('customTitle') const location = this.props.currentDetail.get('location') - return (typeof title === 'string' && title.trim().length > 0) || - (!this.isFolder && typeof location === 'string' && location.trim().length > 0) + return this.isFolder + ? (typeof title === 'string' && title.trim().length > 0) + : (typeof title === 'string' && location.trim().length > 0) } get isFolder () { diff --git a/less/button.less b/less/button.less index eed4527eed5..e6c66a5caba 100644 --- a/less/button.less +++ b/less/button.less @@ -41,8 +41,10 @@ span.browserButton, } &[disabled] { - opacity: .25; pointer-events: none; + // prevent titleMode animation from overriding opacity + animation: none !important; + opacity: .25 !important; } &.smallButton {