Catrope has uploaded a new change for review.
https://gerrit.wikimedia.org/r/73904
Change subject: Make the clear button clear insertion annotations too
......................................................................
Make the clear button clear insertion annotations too
There previously was no way to clear them other than to manually
unset each one.
Change-Id: I553d224595e424cb8a743ea70031503d1fe00b6a
---
M modules/ve/ui/actions/ve.ui.AnnotationAction.js
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/04/73904/1
diff --git a/modules/ve/ui/actions/ve.ui.AnnotationAction.js
b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
index 2b234d0..99f15f2 100644
--- a/modules/ve/ui/actions/ve.ui.AnnotationAction.js
+++ b/modules/ve/ui/actions/ve.ui.AnnotationAction.js
@@ -94,7 +94,8 @@
*/
ve.ui.AnnotationAction.prototype.clearAll = function () {
var i, len, arr,
- fragment = this.surface.getModel().getFragment(),
+ surfaceModel = this.surface.getModel(),
+ fragment = surfaceModel.getFragment(),
annotations = fragment.getAnnotations( true );
arr = annotations.get();
@@ -103,6 +104,7 @@
for ( i = 0, len = arr.length; i < len; i++ ) {
fragment.annotateContent( 'clear', arr[i].name, arr[i].data );
}
+ surfaceModel.setInsertionAnnotations( null );
};
/* Registration */
--
To view, visit https://gerrit.wikimedia.org/r/73904
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I553d224595e424cb8a743ea70031503d1fe00b6a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Catrope <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits