Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Disable option to add a bookmark without location and a folder without a title. #5034

Merged
merged 1 commit into from
Oct 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions js/components/addEditBookmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
4 changes: 3 additions & 1 deletion less/button.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ span.browserButton,
}

&[disabled] {
opacity: .25;
pointer-events: none;
// prevent titleMode animation from overriding opacity
Copy link
Member

@bsclifton bsclifton Oct 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cezaraugusto was this file intentionally added?

Copy link
Contributor Author

@cezaraugusto cezaraugusto Oct 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, our disabled buttons have a small opacity and titleMode's fadeIn animation overrides it.

If not set this way, disabled buttons still look enabled for users.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome! merging 😄

animation: none !important;
opacity: .25 !important;
}

&.smallButton {
Expand Down