From e8272e748c37883d83c2c3dcaaadf009b23726c7 Mon Sep 17 00:00:00 2001 From: Damyon Wiese Date: Thu, 22 Sep 2016 09:23:17 +0800 Subject: [PATCH] MDL-55071 theme_boost: Fix relevant JS warnings Part of MDL-55071 --- lib/form/dndupload.js | 16 ++++++++-------- lib/form/form.js | 3 ++- mod/feedback/yui/dragdrop/dragdrop.js | 10 +++++----- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lib/form/dndupload.js b/lib/form/dndupload.js index 82f1bed2f9f..a902435bb24 100644 --- a/lib/form/dndupload.js +++ b/lib/form/dndupload.js @@ -553,10 +553,10 @@ M.form_dndupload.init = function(Y, options) { this.msg_dlg_node.generateID(); this.msg_dlg = new M.core.dialogue({ - bodyContent : this.msg_dlg_node, - centered : true, - modal : true, - visible : false + bodyContent: this.msg_dlg_node, + centered: true, + modal: true, + visible: false }); this.msg_dlg.plug(Y.Plugin.Drag,{handles:['#'+this.msg_dlg_node.get('id')+' .yui3-widget-hd']}); this.msg_dlg_node.one('.fp-msg-butok').on('click', function(e) { @@ -710,11 +710,11 @@ M.form_dndupload.init = function(Y, options) { var node = process_dlg_node; node.generateID(); var process_dlg = new M.core.dialogue({ - bodyContent : node, + bodyContent: node, headerContent: M.util.get_string('fileexistsdialogheader', 'repository'), - centered : true, - modal : true, - visible : false + centered: true, + modal: true, + visible: false }); process_dlg.plug(Y.Plugin.Drag,{handles:['#'+node.get('id')+' .yui3-widget-hd']}); diff --git a/lib/form/form.js b/lib/form/form.js index 530132f8545..43e209c394a 100644 --- a/lib/form/form.js +++ b/lib/form/form.js @@ -277,7 +277,8 @@ if (typeof M.form.dependencyManager === 'undefined') { isFilePicker: function(el) { if (!this._fileinputs) { var fileinputs = {}; - var els = this.get('form').all('.fitem [data-fieldtype="filepicker"] input,.fitem [data-fieldtype="filemanager"] input'); + var selector = '.fitem [data-fieldtype="filepicker"] input,.fitem [data-fieldtype="filemanager"] input'; + var els = this.get('form').all(selector); els.each(function(node) { fileinputs[node.getAttribute('name')] = true; }); diff --git a/mod/feedback/yui/dragdrop/dragdrop.js b/mod/feedback/yui/dragdrop/dragdrop.js index 532f7729200..31f117fab7e 100644 --- a/mod/feedback/yui/dragdrop/dragdrop.js +++ b/mod/feedback/yui/dragdrop/dragdrop.js @@ -1,11 +1,11 @@ YUI.add('moodle-mod_feedback-dragdrop', function(Y) { var DRAGDROPNAME = 'mod_feedback_dragdrop'; var CSS = { - DRAGAREA : '#feedback_dragarea', - DRAGITEMCLASS : 'feedback_itemlist', - DRAGITEM : 'div.feedback_itemlist', - DRAGLIST : '#feedback_dragarea form', - DRAGHANDLE : 'itemhandle' + DRAGAREA: '#feedback_dragarea', + DRAGITEMCLASS: 'feedback_itemlist', + DRAGITEM: 'div.feedback_itemlist', + DRAGLIST: '#feedback_dragarea form', + DRAGHANDLE: 'itemhandle' }; var DRAGDROP = function() {