Skip to content

Commit

Permalink
MDL-56324 assignfeedback_editpdf: Revert erroneous commits
Browse files Browse the repository at this point in the history
This reverts commits 88d309d and 3cd718e.
  • Loading branch information
tonyjbutler committed Mar 17, 2017
1 parent 98c4094 commit 05aa787
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 47 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2298,18 +2298,18 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor'),
pageselect = editor.get_dialogue_element(SELECTOR.PAGESELECT);
editor = this.get('editor');

this.hide();

editor.currentpage = parseInt(pageselect.get('value'), 10);
if (comment.pageno !== editor.currentpage) {
if (comment.pageno === editor.currentpage) {
comment.drawable.nodes[0].one('textarea').focus();
} else {
// Comment is on a different page.
editor.currentpage = comment.pageno;
editor.change_page();
comment.drawable.nodes[0].one('textarea').focus();
}
comment.drawable.nodes[0].one('textarea').focus();
},

/**
Expand Down Expand Up @@ -4225,11 +4225,8 @@ EDITOR.prototype = {
return;
}
var ajaxurl = AJAXBASE,
pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT),
config;

this.currentpage = parseInt(pageselect.get('value'), 10);

config = {
method: 'post',
context: this,
Expand Down Expand Up @@ -4402,9 +4399,7 @@ EDITOR.prototype = {
*/
previous_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) - 1;
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
}
Expand All @@ -4418,9 +4413,7 @@ EDITOR.prototype = {
*/
next_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) + 1;
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2298,18 +2298,18 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor'),
pageselect = editor.get_dialogue_element(SELECTOR.PAGESELECT);
editor = this.get('editor');

this.hide();

editor.currentpage = parseInt(pageselect.get('value'), 10);
if (comment.pageno !== editor.currentpage) {
if (comment.pageno === editor.currentpage) {
comment.drawable.nodes[0].one('textarea').focus();
} else {
// Comment is on a different page.
editor.currentpage = comment.pageno;
editor.change_page();
comment.drawable.nodes[0].one('textarea').focus();
}
comment.drawable.nodes[0].one('textarea').focus();
},

/**
Expand Down Expand Up @@ -4225,11 +4225,8 @@ EDITOR.prototype = {
return;
}
var ajaxurl = AJAXBASE,
pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT),
config;

this.currentpage = parseInt(pageselect.get('value'), 10);

config = {
method: 'post',
context: this,
Expand Down Expand Up @@ -4402,9 +4399,7 @@ EDITOR.prototype = {
*/
previous_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) - 1;
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
}
Expand All @@ -4418,9 +4413,7 @@ EDITOR.prototype = {
*/
next_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) + 1;
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
}
Expand Down
10 changes: 5 additions & 5 deletions mod/assign/feedback/editpdf/yui/src/editor/js/commentsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,18 @@ Y.extend(COMMENTSEARCH, M.core.dialogue, {
e.preventDefault();
var target = e.target.ancestor('li'),
comment = target.getData('comment'),
editor = this.get('editor'),
pageselect = editor.get_dialogue_element(SELECTOR.PAGESELECT);
editor = this.get('editor');

this.hide();

editor.currentpage = parseInt(pageselect.get('value'), 10);
if (comment.pageno !== editor.currentpage) {
if (comment.pageno === editor.currentpage) {
comment.drawable.nodes[0].one('textarea').focus();
} else {
// Comment is on a different page.
editor.currentpage = comment.pageno;
editor.change_page();
comment.drawable.nodes[0].one('textarea').focus();
}
comment.drawable.nodes[0].one('textarea').focus();
},

/**
Expand Down
11 changes: 2 additions & 9 deletions mod/assign/feedback/editpdf/yui/src/editor/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1134,11 +1134,8 @@ EDITOR.prototype = {
return;
}
var ajaxurl = AJAXBASE,
pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT),
config;

this.currentpage = parseInt(pageselect.get('value'), 10);

config = {
method: 'post',
context: this,
Expand Down Expand Up @@ -1311,9 +1308,7 @@ EDITOR.prototype = {
*/
previous_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) - 1;
this.currentpage--;
if (this.currentpage < 0) {
this.currentpage = 0;
}
Expand All @@ -1327,9 +1322,7 @@ EDITOR.prototype = {
*/
next_page: function(e) {
e.preventDefault();
var pageselect = this.get_dialogue_element(SELECTOR.PAGESELECT);

this.currentpage = parseInt(pageselect.get('value'), 10) + 1;
this.currentpage++;
if (this.currentpage >= this.pages.length) {
this.currentpage = this.pages.length - 1;
}
Expand Down

0 comments on commit 05aa787

Please sign in to comment.