Esanders has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/234279

Change subject: Only show 'insert' button in annotation inspector when content 
is to be inserted
......................................................................

Only show 'insert' button in annotation inspector when content is to be inserted

Currently 'insert' means that a new annotation will be applied, which
is a little confusing. Everywhere else 'insert' means insert new contenst.
Just use 'done' unless new text is actually going to be inserted
(i.e. the inspector was opened on a collapsed selection).

Change-Id: I0ad81f565b585def4687437b317a15a75371b257
---
M src/ui/inspectors/ve.ui.AnnotationInspector.js
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor 
refs/changes/79/234279/1

diff --git a/src/ui/inspectors/ve.ui.AnnotationInspector.js 
b/src/ui/inspectors/ve.ui.AnnotationInspector.js
index 9104254..5a7ba20 100644
--- a/src/ui/inspectors/ve.ui.AnnotationInspector.js
+++ b/src/ui/inspectors/ve.ui.AnnotationInspector.js
@@ -145,10 +145,8 @@
  * @inheritdoc
  */
 ve.ui.AnnotationInspector.prototype.getMode = function () {
-       if ( this.fragment ) {
-               // Trim the fragment before getting selected models to match 
the behavior of
-               // #getSetupProcess
-               return 
this.fragment.trimLinearSelection().getSelectedModels().length ? 'edit' : 
'insert';
+       if ( this.initialSelection ) {
+               return this.initialSelection.isCollapsed() ? 'insert' : 'edit';
        }
        return '';
 };

-- 
To view, visit https://gerrit.wikimedia.org/r/234279
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ad81f565b585def4687437b317a15a75371b257
Gerrit-PatchSet: 1
Gerrit-Project: VisualEditor/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <esand...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to