mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
removing usage of rangy anchornode for determining rendering scope - using model and autoRender
This commit is contained in:
parent
73f53e89c6
commit
76b7127e29
Notes:
christian
2012-03-07 21:41:53 +00:00
|
@ -171,15 +171,14 @@ ve.ce.Surface.prototype.onCutCopy = function( e ) {
|
|||
// we don't like how browsers cut, so let's undo it and do it ourselves.
|
||||
document.execCommand('undo', false, false);
|
||||
|
||||
var selection = _this.getSelectionRange(),
|
||||
node = rangy.getSelection().anchorNode;
|
||||
var selection = _this.getSelectionRange();
|
||||
|
||||
// transact
|
||||
var tx = _this.model.getDocument().prepareRemoval( selection );
|
||||
_this.model.transact( tx );
|
||||
|
||||
// re-render
|
||||
_this.getLeafNode( node ).data( 'view' ).renderContent();
|
||||
_this.autoRender = true;
|
||||
_this.model.transact( tx );
|
||||
_this.autoRender = false;
|
||||
|
||||
_this.clearPollData();
|
||||
|
||||
|
@ -191,8 +190,7 @@ ve.ce.Surface.prototype.onCutCopy = function( e ) {
|
|||
|
||||
ve.ce.Surface.prototype.onPaste = function( e ) {
|
||||
var _this = this,
|
||||
insertionPoint = _this.getSelectionRange().start,
|
||||
node = rangy.getSelection().anchorNode;
|
||||
insertionPoint = _this.getSelectionRange().start;
|
||||
|
||||
$('#paste')
|
||||
.html('')
|
||||
|
|
Loading…
Reference in a new issue