/*! * jQuery Contextify v1.0.7 (http://contextify.js.org) * Copyright (c) 2016 Adam Bouqdib * Licensed under GPL-2.0 (http://abemedia.co.uk/license) */ (function (factory) { if (typeof define === "function" && define.amd) { define(["jquery"], factory) } else { factory(jQuery, window) } }(function ($, window) { var pluginName = "contextify", defaults = { items: [], action: "contextmenu", menuId: "contextify-menu", menuClass: "dropdown-menu", headerClass: "dropdown-header", dividerClass: "divider", before: false }, contextifyId = 0; function Plugin(element, options) { this.element = element; this.options = $.extend({}, defaults, options); this._defaults = defaults; this._name = pluginName; this.init() } Plugin.prototype.init = function () { var options = $.extend({}, this.options, $(this.element).data()), that = $(this); options.id = contextifyId; $(this.element).attr("data-contextify-id", options.id).on("contextmenu", function (e) { e.preventDefault(); if (typeof (options.before) === "function") { options.before(this, options) } var menu = $('