|
24 | 24 | $.widget("ui.contextmenu", {
|
25 | 25 | version: "0.4.1",
|
26 | 26 | options: {
|
27 |
| - delegate: "[data-menu]", // selector |
| 27 | + delegate: "[data-menu]", // selector |
28 | 28 | hide: { effect: "fadeOut", duration: "fast"},
|
29 | 29 | show: { effect: "slideDown", duration: "slow"},
|
30 |
| - position: null, // specify positional preferences (added for issue #18 and #13). |
31 |
| - ignoreParentSelect: true, // Don't trigger 'select' for sub-menu parents |
32 |
| - menu: null, // selector or jQuery or a function returning such |
33 |
| - preventSelect: false, // disable text selection of target |
34 |
| - taphold: false, // open menu on taphold events (requires external plugins) |
| 30 | + position: null, // specify positional preferences (added for issue #18 and #13). |
| 31 | + ignoreParentSelect: true, // Don't trigger 'select' for sub-menu parents |
| 32 | + menu: null, // selector or jQuery or a function returning such |
| 33 | + preventSelect: false, // disable text selection of target |
| 34 | + taphold: false, // open menu on taphold events (requires external plugins) |
35 | 35 | // Events:
|
36 |
| - beforeOpen: $.noop, // menu about to open; return `false` to prevent opening |
37 |
| - blur: $.noop, // menu option lost focus |
38 |
| - close: $.noop, // menu was closed |
39 |
| - create: $.noop, // menu was initialized |
40 |
| - focus: $.noop, // menu option got focus |
41 |
| - init: $.noop, // ui-contextmenu was initialized |
42 |
| - open: $.noop, // menu was opened |
43 |
| - select: $.noop // menu option was selected; return `false` to prevent closing |
| 36 | + beforeOpen: $.noop, // menu about to open; return `false` to prevent opening |
| 37 | + blur: $.noop, // menu option lost focus |
| 38 | + close: $.noop, // menu was closed |
| 39 | + create: $.noop, // menu was initialized |
| 40 | + focus: $.noop, // menu option got focus |
| 41 | + init: $.noop, // ui-contextmenu was initialized |
| 42 | + open: $.noop, // menu was opened |
| 43 | + select: $.noop // menu option was selected; return `false` to prevent closing |
44 | 44 | },
|
45 | 45 | /** Construtcor */
|
46 | 46 | _create: function () {
|
|
157 | 157 | }
|
158 | 158 | });
|
159 | 159 |
|
160 |
| - // required for custom positioning (issue #18 and #13). |
| 160 | + // required for custom positioning (issue #18 and #13). |
161 | 161 | var posOption = this.options.position;
|
162 | 162 |
|
163 |
| - if (posOption == null) { |
| 163 | + if (posOption == null) { |
164 | 164 | posOption = {
|
165 | 165 | my: "left top",
|
166 | 166 | at: "left bottom",
|
167 | 167 | of: parentTarget,
|
168 | 168 | collision: "fit"
|
169 | 169 | }
|
170 |
| - } else if (jQuery.isFunction(this.options.position)) { |
| 170 | + } else if (jQuery.isFunction(this.options.position)) { |
171 | 171 | posOption = posOption(event, ui);
|
172 |
| - } else { |
173 |
| - // do we need to add the of? |
174 |
| - var posTarget = posOption.of; |
175 |
| - if (posTarget == null) { |
| 172 | + } else { |
| 173 | + // do we need to add the of? |
| 174 | + var posTarget = posOption.of; |
| 175 | + if (posTarget == null) { |
176 | 176 | posOption.of = parentTarget;
|
177 |
| - } |
178 |
| - } |
| 177 | + } |
| 178 | + } |
179 | 179 |
|
180 | 180 | // Finally display the popup
|
181 | 181 | $menu
|
|
249 | 249 | $menu.menu("refresh");
|
250 | 250 | }else{
|
251 | 251 | $.error("not implemented");
|
252 |
| -// this.orgMenu = opts.menu; |
253 |
| -// opts.menu = $.ui.contextmenu.createMenuMarkup(data); |
| 252 | +// this.orgMenu = opts.menu; |
| 253 | +// opts.menu = $.ui.contextmenu.createMenuMarkup(data); |
254 | 254 | }
|
255 | 255 | }else{
|
256 |
| -// if(this.orgMenu){ |
257 |
| -// // re-use existing temporary <ul> |
258 |
| -// }else{ |
259 |
| -// } |
260 |
| -// $menu.menu("option", "menu", opts.menu); |
| 256 | +// if(this.orgMenu){ |
| 257 | +// // re-use existing temporary <ul> |
| 258 | +// }else{ |
| 259 | +// } |
| 260 | +// $menu.menu("option", "menu", opts.menu); |
261 | 261 | $.error("not implemented");
|
262 | 262 | }
|
263 | 263 | },
|
|
0 commit comments