Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

{"version":3,"file":"event_base.min.js","sources":["../src/event_base.js"],"sourcesContent":["// This file is part of Moodle - http://moodle.org/\n//\n// Moodle is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Moodle is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.\n\n/**\n * Event base javascript module.\n *\n * @module     tool_lp/event_base\n * @copyright  2015 Frédéric Massart - FMCorz.net\n * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\ndefine(['jquery'], function($) {\n\n    /**\n     * Base class.\n     */\n    var Base = function() {\n        this._eventNode = $('<div></div>');\n    };\n\n    /** @property {Node} The node we attach the events to. */\n    Base.prototype._eventNode = null;\n\n    /**\n     * Register an event listener.\n     *\n     * @param {String} type The event type.\n     * @param {Function} handler The event listener.\n     * @method on\n     */\n    Base.prototype.on = function(type, handler) {\n        this._eventNode.on(type, handler);\n    };\n\n    /**\n     * Trigger an event.\n     *\n     * @param {String} type The type of event.\n     * @param {Object} data The data to pass to the listeners.\n     * @method _trigger\n     */\n    Base.prototype._trigger = function(type, data) {\n        this._eventNode.trigger(type, [data]);\n    };\n\n    return /** @alias module:tool_lp/event_base */ Base;\n});\n"],"names":["define","$","Base","_eventNode","prototype","on","type","handler","_trigger","data","trigger"],"mappings":";;;;;;;AAsBAA,4BAAO,CAAC,WAAW,SAASC,OAKpBC,KAAO,gBACFC,WAAaF,EAAE,uBAIxBC,KAAKE,UAAUD,WAAa,KAS5BD,KAAKE,UAAUC,GAAK,SAASC,KAAMC,cAC1BJ,WAAWE,GAAGC,KAAMC,UAU7BL,KAAKE,UAAUI,SAAW,SAASF,KAAMG,WAChCN,WAAWO,QAAQJ,KAAM,CAACG,QAGYP"}