MDL-43999 Atto : Make image dialogue open on double click of an image.

This commit is contained in:
Damyon Wiese
2014-04-01 15:22:12 +08:00
parent 364411b123
commit 43a737d1b5
5 changed files with 55 additions and 2 deletions
+5
View File
@@ -1,4 +1,9 @@
.atto_image_preview {
max-width: 150px;
max-height: 150px;
margin-bottom: 1em;
}
.editor_atto_content img {
cursor: pointer;
}
@@ -192,6 +192,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tags: 'img',
tagMatchRequiresAll: false
});
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
},
/**
* Handle a double click on an image.
*
* @method _handleDoubleClick
* @param {EventFacade} e
* @private
*/
_handleDoubleClick: function(e) {
var image = e.target;
var selection = this.get('host').getSelectionFromNode(image);
this.get('host').setSelection(selection);
this._displayDialogue();
},
/**
File diff suppressed because one or more lines are too long
@@ -192,6 +192,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tags: 'img',
tagMatchRequiresAll: false
});
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
},
/**
* Handle a double click on an image.
*
* @method _handleDoubleClick
* @param {EventFacade} e
* @private
*/
_handleDoubleClick: function(e) {
var image = e.target;
var selection = this.get('host').getSelectionFromNode(image);
this.get('host').setSelection(selection);
this._displayDialogue();
},
/**
@@ -190,6 +190,22 @@ Y.namespace('M.atto_image').Button = Y.Base.create('button', Y.M.editor_atto.Edi
tags: 'img',
tagMatchRequiresAll: false
});
this.editor.delegate('dblclick', this._handleDoubleClick, 'img', this);
},
/**
* Handle a double click on an image.
*
* @method _handleDoubleClick
* @param {EventFacade} e
* @private
*/
_handleDoubleClick: function(e) {
var image = e.target;
var selection = this.get('host').getSelectionFromNode(image);
this.get('host').setSelection(selection);
this._displayDialogue();
},
/**