Merge branch 'MDL-61010-master' of git://github.com/andrewnicols/moodle
[moodle.git] / question / yui / build / moodle-question-qbankmanager / moodle-question-qbankmanager-min.js
CommitLineData
1a43d6de 1YUI.add("moodle-question-qbankmanager",function(e,t){var n={_header:null,_addbutton:null,_firstCheckbox:null,init:function(){this._header=e.one("#qbheadercheckbox");if(!this._header)return;this._header.setAttrs({disabled:!1,title:M.util.get_string("selectall","moodle")}),this._header.on("click",this._headerClick,this),this._addbutton=e.one('.modulespecificbuttonscontainer input[name="add"]'),this._addbutton&&(this._addbutton.setAttrs({disabled:!0}),this._header.on("click",this._questionClick,this),e.one(".categoryquestionscontainer").delegate("change",this._questionClick,'td.checkbox input[type="checkbox"]',this));var t=this._header.ancestor("table");this._firstCheckbox=t.one("tbody tr td.checkbox input")},_headerClick:function(){var t=e.one("#categoryquestions").all("[type=checkbox],[type=radio]");this._firstCheckbox.get("checked")?(t.set("checked",!1),this._header.setAttribute("title",M.util.get_string("selectall","moodle"))):(t.set("checked",!0),this._header.setAttribute("title",M.util.get_string("deselectall","moodle"))),this._header.set("checked",!1)},_questionClick:function(){var t=e.all('td.checkbox input[type="checkbox"]:checked').size();this._addbutton.setAttrs({disabled:t===0})}};M.question=M.question||{},M.question.qbankmanager=M.question.qbankmanager||n},"@VERSION@",{requires:["node","selector-css3"]});