diff --git a/app/assets/stylesheets/app/_tags.scss b/app/assets/stylesheets/app/_tags.scss index 42d839fc3..815791e9a 100644 --- a/app/assets/stylesheets/app/_tags.scss +++ b/app/assets/stylesheets/app/_tags.scss @@ -51,7 +51,7 @@ transition: height .1s ease-in-out; position: relative; - > .info { + > .tag-info { height: 20px; > .title { @@ -65,6 +65,14 @@ text-overflow: ellipsis; width: 75%; + // Required for Safari to avoid highlighting when dragging panel resizers + // Make sure to undo if it's selected (for editing) + -webkit-user-select: none; + + &.editing { + -webkit-user-select: text !important; + } + pointer-events: none; } @@ -96,8 +104,10 @@ } &.selected { - > .title { - cursor: text; + > .tag-info { + .title { + cursor: text; + } } } diff --git a/app/assets/templates/tags.html.haml b/app/assets/templates/tags.html.haml index d8b6eafde..1a595f18e 100644 --- a/app/assets/templates/tags.html.haml +++ b/app/assets/templates/tags.html.haml @@ -16,7 +16,7 @@ .infinite-scroll .tag{"ng-repeat" => "tag in ctrl.smartTags", "ng-click" => "ctrl.selectTag(tag)", "ng-class" => "{'selected' : ctrl.selectedTag == tag, 'faded' : !tag.content.isAllTag}"} - .info + .tag-info %input.title{"ng-disabled" => "true", "ng-model" => "tag.title"} .count{"ng-show" => "tag.content.isAllTag"} {{tag.cachedNoteCount}} @@ -25,8 +25,8 @@ .sk-h3.title %span.sk-bold Tags .tag{"ng-repeat" => "tag in ctrl.tags track by tag.uuid", "ng-click" => "ctrl.selectTag(tag)", "ng-class" => "{'selected' : ctrl.selectedTag == tag}"} - .info - %input.title{"ng-attr-id" => "tag-{{tag.uuid}}", "ng-click" => "ctrl.selectTag(tag)", "ng-model" => "tag.title", + .tag-info + %input.title{"ng-class" => "{'editing' : ctrl.editingTag == tag}", "ng-attr-id" => "tag-{{tag.uuid}}", "ng-click" => "ctrl.selectTag(tag)", "ng-model" => "tag.title", "ng-keyup" => "$event.keyCode == 13 && $event.target.blur()", "sn-autofocus" => "true", "should-focus" => "ctrl.newTag || ctrl.editingTag == tag", "ng-change" => "ctrl.tagTitleDidChange(tag)", "ng-blur" => "ctrl.saveTag($event, tag)", "spellcheck" => "false"} .count {{tag.cachedNoteCount}}