Merge branch 'MDL-56324-master' of https://github.com/lucisgit/moodle

This commit is contained in:
Dan Poltawski 2017-03-21 11:28:13 +00:00
commit 5fd24a89a6
5 changed files with 26 additions and 47 deletions

View File

@ -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();
},
/**
@ -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,
@ -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;
}
@ -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;
}

View File

@ -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();
},
/**
@ -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,
@ -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;
}
@ -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;
}

View File

@ -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();
},
/**

View File

@ -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,
@ -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;
}
@ -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;
}