forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-31679 gradereport_grader: Add a horizontal scroll bar to the top …
…of the grader report
- Loading branch information
Showing
11 changed files
with
284 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
.../build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
YUI.add('moodle-gradereport_grader-scrollview', function (Y, NAME) { | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
/** | ||
* Scrollview for grader table. | ||
* | ||
* @package gradereport_grader | ||
* @copyright 2013 NetSpot Pty Ltd | ||
* @author Adam Olley <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
M.gradereport_grader = M.gradereport_grader || {}; | ||
M.gradereport_grader.scrollview = { | ||
|
||
/** Selectors. */ | ||
SELECTORS: { | ||
CONTAINER: '.gradeparent', | ||
STATIC: '.gradeparent .right_scroller', | ||
GRADETABLE: '#user-grades' | ||
}, | ||
|
||
container : null, | ||
|
||
/** | ||
* Initialise the scrollview code. | ||
*/ | ||
init: function() { | ||
this.container = Y.one(this.SELECTORS.CONTAINER); | ||
if (!this.container) { | ||
Y.log('No grade container found.'); | ||
return; | ||
} | ||
|
||
var topscroll = Y.Node.create('<div class="right_scroller topscroll"><div class="topscrollcontent"></div></div>'); | ||
|
||
var src = this.SELECTORS.CONTAINER; | ||
if (Y.one(this.SELECTORS.STATIC)) { | ||
src = this.SELECTORS.STATIC; | ||
} | ||
|
||
var node = Y.one(src).insert(topscroll, 'before'); | ||
|
||
if (!Y.one(this.SELECTORS.STATIC)) { | ||
node = Y.one('.topscroll'); | ||
} | ||
|
||
var _this = this; | ||
Y.on('domready', function () { | ||
var width = Y.one(_this.SELECTORS.GRADETABLE).get('offsetWidth'); | ||
Y.one('.topscrollcontent').setStyle('width', width + 'px'); | ||
}); | ||
|
||
Y.one(src).on('scroll', function() { | ||
node.set('scrollLeft', Y.one(src).get('scrollLeft')); | ||
}); | ||
|
||
node.on('scroll', function() { | ||
Y.one(src).set('scrollLeft', node.get('scrollLeft')); | ||
}); | ||
|
||
} | ||
}; | ||
|
||
|
||
}, '@VERSION@', {"requires": ["base", "node"]}); |
1 change: 1 addition & 0 deletions
1
...ui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-min.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
80 changes: 80 additions & 0 deletions
80
...er/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
YUI.add('moodle-gradereport_grader-scrollview', function (Y, NAME) { | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
/** | ||
* Scrollview for grader table. | ||
* | ||
* @package gradereport_grader | ||
* @copyright 2013 NetSpot Pty Ltd | ||
* @author Adam Olley <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
M.gradereport_grader = M.gradereport_grader || {}; | ||
M.gradereport_grader.scrollview = { | ||
|
||
/** Selectors. */ | ||
SELECTORS: { | ||
CONTAINER: '.gradeparent', | ||
STATIC: '.gradeparent .right_scroller', | ||
GRADETABLE: '#user-grades' | ||
}, | ||
|
||
container : null, | ||
|
||
/** | ||
* Initialise the scrollview code. | ||
*/ | ||
init: function() { | ||
this.container = Y.one(this.SELECTORS.CONTAINER); | ||
if (!this.container) { | ||
return; | ||
} | ||
|
||
var topscroll = Y.Node.create('<div class="right_scroller topscroll"><div class="topscrollcontent"></div></div>'); | ||
|
||
var src = this.SELECTORS.CONTAINER; | ||
if (Y.one(this.SELECTORS.STATIC)) { | ||
src = this.SELECTORS.STATIC; | ||
} | ||
|
||
var node = Y.one(src).insert(topscroll, 'before'); | ||
|
||
if (!Y.one(this.SELECTORS.STATIC)) { | ||
node = Y.one('.topscroll'); | ||
} | ||
|
||
var _this = this; | ||
Y.on('domready', function () { | ||
var width = Y.one(_this.SELECTORS.GRADETABLE).get('offsetWidth'); | ||
Y.one('.topscrollcontent').setStyle('width', width + 'px'); | ||
}); | ||
|
||
Y.one(src).on('scroll', function() { | ||
node.set('scrollLeft', Y.one(src).get('scrollLeft')); | ||
}); | ||
|
||
node.on('scroll', function() { | ||
Y.one(src).set('scrollLeft', node.get('scrollLeft')); | ||
}); | ||
|
||
} | ||
}; | ||
|
||
|
||
}, '@VERSION@', {"requires": ["base", "node"]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "moodle-gradereport_grader-scrollview", | ||
"builds": { | ||
"moodle-gradereport_grader-scrollview": { | ||
"jsfiles": [ | ||
"scrollview.js" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Moodle is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
/** | ||
* Scrollview for grader table. | ||
* | ||
* @package gradereport_grader | ||
* @copyright 2013 NetSpot Pty Ltd | ||
* @author Adam Olley <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
M.gradereport_grader = M.gradereport_grader || {}; | ||
M.gradereport_grader.scrollview = { | ||
|
||
/** Selectors. */ | ||
SELECTORS: { | ||
CONTAINER: '.gradeparent', | ||
STATIC: '.gradeparent .right_scroller', | ||
GRADETABLE: '#user-grades' | ||
}, | ||
|
||
container : null, | ||
|
||
/** | ||
* Initialise the scrollview code. | ||
*/ | ||
init: function() { | ||
this.container = Y.one(this.SELECTORS.CONTAINER); | ||
if (!this.container) { | ||
Y.log('No grade container found.'); | ||
return; | ||
} | ||
|
||
var topscroll = Y.Node.create('<div class="right_scroller topscroll"><div class="topscrollcontent"></div></div>'); | ||
|
||
var src = this.SELECTORS.CONTAINER; | ||
if (Y.one(this.SELECTORS.STATIC)) { | ||
src = this.SELECTORS.STATIC; | ||
} | ||
|
||
var node = Y.one(src).insert(topscroll, 'before'); | ||
|
||
if (!Y.one(this.SELECTORS.STATIC)) { | ||
node = Y.one('.topscroll'); | ||
} | ||
|
||
var _this = this; | ||
Y.on('domready', function () { | ||
var width = Y.one(_this.SELECTORS.GRADETABLE).get('offsetWidth'); | ||
Y.one('.topscrollcontent').setStyle('width', width + 'px'); | ||
}); | ||
|
||
Y.one(src).on('scroll', function() { | ||
node.set('scrollLeft', Y.one(src).get('scrollLeft')); | ||
}); | ||
|
||
node.on('scroll', function() { | ||
Y.one(src).set('scrollLeft', node.get('scrollLeft')); | ||
}); | ||
|
||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"moodle-gradereport_grader-scrollview": { | ||
"requires": [ | ||
"base", | ||
"node" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.