WebFormDesigner/js/BootstrapMenu.js
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
'use strict';
var classNames = require('classnames');
var $ = require('jquery');
require('jquery-ui/position');
// modular lodash requires
var _ = function() {
throw new Error('Custom lodash build for BootstrapMenu. lodash chaining is not included');
};
_.noop = require('lodash/utility/noop');
_.each = require('lodash/collection/each');
_.contains = require('lodash/collection/contains');
_.extend = require('lodash/object/extend');
_.uniqueId = require('lodash/utility/uniqueId');
_.isFunction = require('lodash/lang/isFunction');
var defaultOptions = {
/* container of the context menu, where it will be created and where
* event listeners will be installed. */
container: 'body',
/* user-defined function to obtain specific data about the currently
* opened element, to pass it to the rest of user-defined functions
* of an action. */
fetchElementData: _.noop,
/* what the source of the context menu should be when opened.
* Valid values are 'mouse' and 'element'. */
menuSource: 'mouse',
/* how to calculate the position of the context menu based on its source.
* Valid values are 'aboveLeft', 'aboveRight', 'belowLeft', and 'belowRight'. */
menuPosition: 'belowLeft',
/* the event to listen to open the menu.
* Valid values are 'click', 'right-click', 'hover' */
menuEvent: 'right-click', // TODO rename to menuAction in next mayor version
/* group actions to render them next to each other, with a separator
* between each group. */
actionsGroups: [],
/* In some weird cases, another plugin may be installing 'click' listeners
* in the anchors used for each action of the context menu, and stopping
* the event bubbling before it reachs this plugin's listener.
*
* For those cases, _actionSelectEvent can be used to change the event we
* listen to, for example to 'mousedown'.
*
* Unless the context menu is not working due to this and a workaround is
* needed, this option can be safely ignored.
*/
_actionSelectEvent: 'click'
};
function renderMenu(_this) {
var $menu = $('<div class="dropdown bootstrapMenu" style="z-index:1000;position:absolute;" />');
后面还有 347 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读 AI
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
