Current Path : C:/xampp/htdocs/moodle/mod/assign/amd/build/ |
Current File : C:/xampp/htdocs/moodle/mod/assign/amd/build/grading_actions.min.js |
define ("mod_assign/grading_actions",["jquery","mod_assign/grading_events"],function(a,b){var c=function(b){this._regionSelector=b;this._region=a(b);this.registerEventListeners()};c.prototype._regionSelector=null;c.prototype._lastUserId=0;c.prototype._region=null;c.prototype._showActionsForm=function(a,b){var c=this._region.find("[data-region=grading-actions-form]");if(b!=this._lastUserId&&0<b){this._lastUserId=b}if(0<b){c.removeClass("hide")}else{c.addClass("hide")}};c.prototype._trigger=function(b){a(document).trigger(b)};c.prototype.getReviewPanelElement=function(){return a("[data-region=\"review-panel\"]")};c.prototype.hasReviewPanelElement=function(){return 0<this.getReviewPanelElement().length};c.prototype.getCollapseGradePanelButton=function(){return a("[data-region=\"grade-actions\"] .collapse-grade-panel")};c.prototype.getCollapseReviewPanelButton=function(){return a("[data-region=\"grade-actions\"] .collapse-review-panel")};c.prototype.getExpandAllPanelsButton=function(){return a("[data-region=\"grade-actions\"] .collapse-none")};c.prototype.resetLayoutButtons=function(){this.getCollapseGradePanelButton().removeClass("active");this.getCollapseReviewPanelButton().removeClass("active");this.getExpandAllPanelsButton().removeClass("active")};c.prototype.collapseReviewPanel=function(){a(document).trigger(b.COLLAPSE_REVIEW_PANEL);a(document).trigger(b.EXPAND_GRADE_PANEL);this.resetLayoutButtons();this.getCollapseReviewPanelButton().addClass("active")};c.prototype.collapseGradePanel=function(){a(document).trigger(b.COLLAPSE_GRADE_PANEL);a(document).trigger(b.EXPAND_REVIEW_PANEL);this.resetLayoutButtons();this.getCollapseGradePanelButton().addClass("active")};c.prototype.expandAllPanels=function(){a(document).trigger(b.EXPAND_GRADE_PANEL);a(document).trigger(b.EXPAND_REVIEW_PANEL);this.resetLayoutButtons();this.getExpandAllPanelsButton().addClass("active")};c.prototype.registerEventListeners=function(){if(this.hasReviewPanelElement()){var b=this.getCollapseReviewPanelButton();b.click(function(a){this.collapseReviewPanel();a.preventDefault()}.bind(this));b.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.collapseReviewPanel();a.preventDefault()}}}.bind(this));var c=this.getCollapseGradePanelButton();c.click(function(a){this.collapseGradePanel();a.preventDefault()}.bind(this));c.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.collapseGradePanel();a.preventDefault()}}}.bind(this));var d=this.getExpandAllPanelsButton();d.click(function(a){this.expandAllPanels();a.preventDefault()}.bind(this));d.keydown(function(a){if(!a.metaKey&&!a.shiftKey&&!a.altKey&&!a.ctrlKey){if(13===a.keyCode||32===a.keyCode){this.expandAllPanels();a.preventDefault()}}}.bind(this))}a(document).on("user-changed",this._showActionsForm.bind(this));this._region.find("[name=\"savechanges\"]").on("click",this._trigger.bind(this,"save-changes"));this._region.find("[name=\"saveandshownext\"]").on("click",this._trigger.bind(this,"save-and-show-next"));this._region.find("[name=\"resetbutton\"]").on("click",this._trigger.bind(this,"reset"));this._region.find("form").on("submit",function(a){a.preventDefault()})};return c}); //# sourceMappingURL=grading_actions.min.js.map