MDL-47738 gradereport_history: User selector handles broke with 0 user
authorFrederic Massart <fred@moodle.com>
Fri, 17 Oct 2014 11:34:16 +0000 (19:34 +0800)
committerFrederic Massart <fred@moodle.com>
Fri, 17 Oct 2014 11:34:16 +0000 (19:34 +0800)
It was impossible to reopen the dialogue when the last search result
did not return any user.

grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-debug.js
grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-min.js
grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector.js
grade/report/history/yui/src/userselector/js/userselector.js

index a305c9a..a53eb2a 100644 (file)
Binary files a/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-debug.js and b/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-debug.js differ
index 6efa157..8d69f0d 100644 (file)
Binary files a/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-min.js and b/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector-min.js differ
index 3209946..390997d 100644 (file)
Binary files a/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector.js and b/grade/report/history/yui/build/moodle-gradereport_history-userselector/moodle-gradereport_history-userselector.js differ
index 38f662e..0622cb9 100644 (file)
@@ -641,6 +641,10 @@ Y.namespace('M.gradereport_history').UserSelector = Y.extend(USERSELECTOR, M.cor
         if (this._userTabFocus) {
             this._userTabFocus.setAttribute('tabindex', '-1');
         }
+        if (!user) {
+            // We were not passed a user, there is apparently none in the dialogue. Nothing to do here \\\o/.
+            return;
+        }
 
         this._userTabFocus = user.one(SELECTORS.USERSELECT);
         this._userTabFocus.setAttribute('tabindex', '0');