From 08b90682e4f961eef2bc26ec0754caa5978a7697 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 2 May 2014 10:47:27 +0800 Subject: [PATCH] MDL-45314 core_grade: a JS fix for the grader report --- .../moodle-gradereport_grader-scrollview-debug.js | 7 +++---- .../moodle-gradereport_grader-scrollview-min.js | 2 +- .../moodle-gradereport_grader-scrollview.js | 7 +++---- grade/report/grader/yui/src/scrollview/js/scrollview.js | 7 +++---- 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-debug.js b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-debug.js index 86000f95658..3fbb8b1fbd8 100644 --- a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-debug.js +++ b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-debug.js @@ -60,10 +60,9 @@ M.gradereport_grader.scrollview = { node = Y.one('.topscroll'); } - var _this = this; Y.on('domready', function () { - M.gradereport_grader.scrollview.resize(); - }); + this.resize(); + }, this); Y.one(src).on('scroll', function() { node.set('scrollLeft', Y.one(src).get('scrollLeft')); @@ -76,7 +75,7 @@ M.gradereport_grader.scrollview = { }, resize: function() { - var width = Y.one(M.gradereport_grader.scrollview.SELECTORS.GRADETABLE).get('offsetWidth'); + var width = Y.one(this.SELECTORS.GRADETABLE).get('offsetWidth'); Y.one('.topscrollcontent').setStyle('width', width + 'px'); } }; diff --git a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-min.js b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-min.js index 4c13fae49b9..33c8b8d2add 100644 --- a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-min.js +++ b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview-min.js @@ -1 +1 @@ -YUI.add("moodle-gradereport_grader-scrollview",function(e,t){M.gradereport_grader=M.gradereport_grader||{},M.gradereport_grader.scrollview={SELECTORS:{CONTAINER:".gradeparent",STATIC:".gradeparent .right_scroller",GRADETABLE:"#user-grades"},container:null,init:function(){this.container=e.one(this.SELECTORS.CONTAINER);if(!this.container)return;var t=e.Node.create('
'),n=this.SELECTORS.CONTAINER;e.one(this.SELECTORS.STATIC)&&(n=this.SELECTORS.STATIC);var r=e.one(n).insert(t,"before");e.one(this.SELECTORS.STATIC)||(r=e.one(".topscroll"));var i=this;e.on("domready",function(){M.gradereport_grader.scrollview.resize()}),e.one(n).on("scroll",function(){r.set("scrollLeft",e.one(n).get("scrollLeft"))}),r.on("scroll",function(){e.one(n).set("scrollLeft",r.get("scrollLeft"))})},resize:function(){var t=e.one(M.gradereport_grader.scrollview.SELECTORS.GRADETABLE).get("offsetWidth");e.one(".topscrollcontent").setStyle("width",t+"px")}}},"@VERSION@",{requires:["base","node"]}); +YUI.add("moodle-gradereport_grader-scrollview",function(e,t){M.gradereport_grader=M.gradereport_grader||{},M.gradereport_grader.scrollview={SELECTORS:{CONTAINER:".gradeparent",STATIC:".gradeparent .right_scroller",GRADETABLE:"#user-grades"},container:null,init:function(){this.container=e.one(this.SELECTORS.CONTAINER);if(!this.container)return;var t=e.Node.create('
'),n=this.SELECTORS.CONTAINER;e.one(this.SELECTORS.STATIC)&&(n=this.SELECTORS.STATIC);var r=e.one(n).insert(t,"before");e.one(this.SELECTORS.STATIC)||(r=e.one(".topscroll")),e.on("domready",function(){this.resize()},this),e.one(n).on("scroll",function(){r.set("scrollLeft",e.one(n).get("scrollLeft"))}),r.on("scroll",function(){e.one(n).set("scrollLeft",r.get("scrollLeft"))})},resize:function(){var t=e.one(this.SELECTORS.GRADETABLE).get("offsetWidth");e.one(".topscrollcontent").setStyle("width",t+"px")}}},"@VERSION@",{requires:["base","node"]}); diff --git a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview.js b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview.js index a61827dd6c7..0ffaa7c9435 100644 --- a/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview.js +++ b/grade/report/grader/yui/build/moodle-gradereport_grader-scrollview/moodle-gradereport_grader-scrollview.js @@ -59,10 +59,9 @@ M.gradereport_grader.scrollview = { node = Y.one('.topscroll'); } - var _this = this; Y.on('domready', function () { - M.gradereport_grader.scrollview.resize(); - }); + this.resize(); + }, this); Y.one(src).on('scroll', function() { node.set('scrollLeft', Y.one(src).get('scrollLeft')); @@ -75,7 +74,7 @@ M.gradereport_grader.scrollview = { }, resize: function() { - var width = Y.one(M.gradereport_grader.scrollview.SELECTORS.GRADETABLE).get('offsetWidth'); + var width = Y.one(this.SELECTORS.GRADETABLE).get('offsetWidth'); Y.one('.topscrollcontent').setStyle('width', width + 'px'); } }; diff --git a/grade/report/grader/yui/src/scrollview/js/scrollview.js b/grade/report/grader/yui/src/scrollview/js/scrollview.js index 1c67dff10c2..1cf46acd34a 100644 --- a/grade/report/grader/yui/src/scrollview/js/scrollview.js +++ b/grade/report/grader/yui/src/scrollview/js/scrollview.js @@ -58,10 +58,9 @@ M.gradereport_grader.scrollview = { node = Y.one('.topscroll'); } - var _this = this; Y.on('domready', function () { - M.gradereport_grader.scrollview.resize(); - }); + this.resize(); + }, this); Y.one(src).on('scroll', function() { node.set('scrollLeft', Y.one(src).get('scrollLeft')); @@ -74,7 +73,7 @@ M.gradereport_grader.scrollview = { }, resize: function() { - var width = Y.one(M.gradereport_grader.scrollview.SELECTORS.GRADETABLE).get('offsetWidth'); + var width = Y.one(this.SELECTORS.GRADETABLE).get('offsetWidth'); Y.one('.topscrollcontent').setStyle('width', width + 'px'); } };