Merge branch 'MDL-42352_editpdf_scrolling' of git://github.com/davosmith/moodle

Conflicts:
	mod/assign/feedback/editpdf/yui/build/moodle-assignfeedback_editpdf-editor/moodle-assignfeedback_editpdf-editor-min.js
This commit is contained in:
Dan Poltawski
2013-11-01 08:56:53 +08:00
committed by Sam Hemelryk
11 changed files with 64 additions and 25 deletions
@@ -669,9 +669,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
remove : function() {
remove : function(e) {
var annotations;
e.preventDefault();
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
@@ -1579,7 +1581,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
button.on('click', this.show, this);
button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
@@ -1684,6 +1686,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1800,6 +1804,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1892,7 +1897,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('<li><a tabindex="-1" href="#">' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '</a></li>');
link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
@@ -2058,6 +2063,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
@@ -2449,6 +2455,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -2462,6 +2470,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -2479,7 +2489,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
this.add_to_quicklist = function() {
this.add_to_quicklist = function(e) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
@@ -3800,7 +3811,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
previous_page : function() {
previous_page : function(e) {
e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -3813,7 +3825,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
next_page : function() {
next_page : function(e) {
e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
File diff suppressed because one or more lines are too long
@@ -669,9 +669,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
remove : function() {
remove : function(e) {
var annotations;
e.preventDefault();
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
@@ -1579,7 +1581,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
button.on('click', this.show, this);
button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
@@ -1684,6 +1686,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1800,6 +1804,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
@@ -1892,7 +1897,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('<li><a tabindex="-1" href="#">' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '</a></li>');
link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
@@ -2058,6 +2063,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
@@ -2449,6 +2455,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -2462,6 +2470,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -2479,7 +2489,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
this.add_to_quicklist = function() {
this.add_to_quicklist = function(e) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
@@ -3800,7 +3811,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
previous_page : function() {
previous_page : function(e) {
e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -3813,7 +3825,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
next_page : function() {
next_page : function(e) {
e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
@@ -233,9 +233,11 @@ Y.extend(ANNOTATION, Y.Base, {
* @method remove
* @param event
*/
remove : function() {
remove : function(e) {
var annotations;
e.preventDefault();
annotations = this.editor.pages[this.editor.currentpage].annotations;
for (i = 0; i < annotations.length; i++) {
if (annotations[i] === this) {
@@ -58,6 +58,8 @@ Y.extend(COLOURPICKER, M.assignfeedback_editpdf.dropdown, {
COLOURPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;
+6 -1
View File
@@ -330,6 +330,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method remove_from_quicklist
*/
this.remove_from_quicklist = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.remove(quickcomment);
@@ -343,6 +345,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @method set_from_quick_comment
*/
this.set_from_quick_comment = function(e, quickcomment) {
e.preventDefault();
this.menu.hide();
this.rawtext = quickcomment.rawtext;
@@ -360,7 +364,8 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
* @protected
* @method add_to_quicklist
*/
this.add_to_quicklist = function() {
this.add_to_quicklist = function(e) {
e.preventDefault();
this.menu.hide();
this.editor.quicklist.add(this);
};
@@ -39,7 +39,7 @@ Y.extend(COMMENTMENU, M.assignfeedback_editpdf.dropdown, {
commentlinks.append(link);
link = Y.Node.create('<li><a tabindex="-1" href="#">' + M.util.get_string('deletecomment', 'assignfeedback_editpdf') + '</a></li>');
link.on('click', function() { comment.menu.hide(); comment.remove(); }, comment);
link.on('click', function(e) { e.preventDefault(); this.menu.hide(); this.remove(); }, comment);
link.on('key', function() { comment.menu.hide(); comment.remove(); }, 'enter,space', comment);
commentlinks.append(link);
@@ -92,6 +92,7 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
* @method focus_on_comment
*/
focus_on_comment : function(e) {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor');
+1 -1
View File
@@ -55,7 +55,7 @@ Y.extend(DROPDOWN, M.core.dialogue, {
}
}, this);
button.on('click', this.show, this);
button.on('click', function(e) {e.preventDefault(); this.show();}, this);
button.on('key', this.show, 'enter,space', this);
},
+4 -2
View File
@@ -987,7 +987,8 @@ EDITOR.prototype = {
* @protected
* @method previous_page
*/
previous_page : function() {
previous_page : function(e) {
e.preventDefault();
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
@@ -1000,7 +1001,8 @@ EDITOR.prototype = {
* @protected
* @method next_page
*/
next_page : function() {
next_page : function(e) {
e.preventDefault();
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
@@ -52,6 +52,7 @@ Y.extend(STAMPPICKER, M.assignfeedback_editpdf.dropdown, {
STAMPPICKER.superclass.initializer.call(this, config);
},
callback_handler : function(e) {
e.preventDefault();
var callback = this.get('callback'),
callbackcontext = this.get('context'),
bind;