Skip to content

Commit bbbf33c

Browse files
committed
Tweak positioning of submenu (closes #387)
1 parent 42f0160 commit bbbf33c

5 files changed

+13
-12
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212

1313
* Quick fix for error in visible check ([Issue #484](https://github.com/swisnl/jQuery-contextMenu/issues/484))
1414

15+
####
16+
17+
* Tweaked positioning of submenu ([Issue #387](https://github.com/swisnl/jQuery-contextMenu/issues/387))
1518

1619
### 2.4.0 ###
1720

dist/jquery.contextMenu.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* MIT License http://www.opensource.org/licenses/mit-license
1313
* GPL v3 http://opensource.org/licenses/GPL-3.0
1414
*
15-
* Date: 2016-12-15T20:10:00.006Z
15+
* Date: 2016-12-15T21:07:54.582Z
1616
*/
1717

1818
(function (factory) {
@@ -206,16 +206,16 @@
206206
// .position() is provided as a jQuery UI utility
207207
// (...and it won't work on hidden elements)
208208
$menu.css('display', 'block').position({
209-
my: 'left top',
209+
my: 'left top-5',
210210
at: 'right top',
211211
of: this,
212212
collision: 'flipfit fit'
213213
}).css('display', '');
214214
} else {
215215
// determine contextMenu position
216216
var offset = {
217-
top: 0,
218-
left: this.outerWidth()
217+
top: -9,
218+
left: this.outerWidth() - 5
219219
};
220220
$menu.css(offset);
221221
}
@@ -1540,7 +1540,6 @@
15401540

15411541
// manage contextMenu instances
15421542
$.contextMenu = function (operation, options) {
1543-
15441543
if (typeof operation !== 'string') {
15451544
options = operation;
15461545
operation = 'create';

dist/jquery.contextMenu.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.contextMenu.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/jquery.contextMenu.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@
206206
// .position() is provided as a jQuery UI utility
207207
// (...and it won't work on hidden elements)
208208
$menu.css('display', 'block').position({
209-
my: 'left top',
209+
my: 'left top-5',
210210
at: 'right top',
211211
of: this,
212212
collision: 'flipfit fit'
213213
}).css('display', '');
214214
} else {
215215
// determine contextMenu position
216216
var offset = {
217-
top: 0,
218-
left: this.outerWidth()
217+
top: -9,
218+
left: this.outerWidth() - 5
219219
};
220220
$menu.css(offset);
221221
}
@@ -1540,7 +1540,6 @@
15401540

15411541
// manage contextMenu instances
15421542
$.contextMenu = function (operation, options) {
1543-
15441543
if (typeof operation !== 'string') {
15451544
options = operation;
15461545
operation = 'create';

0 commit comments

Comments
 (0)