Sindbad~EG File Manager
/**
* Manage the timeline view navigation for the overview block.
*
* @copyright 2018 Bas Brands <bas@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
define("block_myoverview/view_nav",["jquery","core/custom_interaction_events","block_myoverview/repository","block_myoverview/view","block_myoverview/selectors"],(function($,CustomEvents,Repository,View,Selectors){var SELECTORS_FILTERS='[data-region="filter"]',SELECTORS_FILTER_OPTION="[data-filter]",SELECTORS_DISPLAY_OPTION="[data-display-option]",updatePreferences=function(filter,value){var type=null;type="display"==filter?"block_myoverview_user_view_preference":"sort"==filter?"block_myoverview_user_sort_preference":"customfieldvalue"==filter?"block_myoverview_user_grouping_customfieldvalue_preference":"block_myoverview_user_grouping_preference",Repository.updateUserPreferences({preferences:[{type:type,value:value}]})};return{init:function(root){!function(root){var Selector=root.find(SELECTORS_FILTERS);CustomEvents.define(Selector,[CustomEvents.events.activate]),Selector.on(CustomEvents.events.activate,SELECTORS_FILTER_OPTION,(function(e,data){var option=$(e.target);if(!option.hasClass("active")){var filter=option.attr("data-filter"),pref=option.attr("data-pref"),customfieldvalue=option.attr("data-customfieldvalue");root.find(Selectors.courseView.region).attr("data-"+filter,option.attr("data-value")),updatePreferences(filter,pref),customfieldvalue&&(root.find(Selectors.courseView.region).attr("data-customfieldvalue",customfieldvalue),updatePreferences("customfieldvalue",customfieldvalue)),View.init(root),data.originalEvent.preventDefault()}})),CustomEvents.define(Selector,[CustomEvents.events.activate]),Selector.on(CustomEvents.events.activate,SELECTORS_DISPLAY_OPTION,(function(e,data){var option=$(e.target);if(!option.hasClass("active")){var filter=option.attr("data-display-option"),pref=option.attr("data-pref");root.find(Selectors.courseView.region).attr("data-display",option.attr("data-value")),updatePreferences(filter,pref),View.reset(root),data.originalEvent.preventDefault()}}))}(root=$(root))}}}));
//# sourceMappingURL=view_nav.min.js.map
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists