Skip to content
Snippets Groups Projects
Commit eaca1954 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

context menu visualization fixed - it's slightly different in bootstrap 4

parent 5a19f11e
No related branches found
No related tags found
1 merge request!878Resolve "MolArt is missing in the context menu (right click). // minerva v14"
Pipeline #12734 passed
...@@ -11,6 +11,7 @@ minerva (14.0.0~alpha.1) unstable; urgency=low ...@@ -11,6 +11,7 @@ minerva (14.0.0~alpha.1) unstable; urgency=low
* Bug fix: upload of invalid plugin doesn't add it to plugin tab and list of * Bug fix: upload of invalid plugin doesn't add it to plugin tab and list of
loaded plugins (#885) loaded plugins (#885)
* Bug fix: link to molart was brokwn (#886) * Bug fix: link to molart was brokwn (#886)
* Bug fix: context menu visualization fixed
-- Piotr Gawron <piotr.gawron@uni.lu> Mon, 12 Aug 2019 10:00:00 +0200 -- Piotr Gawron <piotr.gawron@uni.lu> Mon, 12 Aug 2019 10:00:00 +0200
......
...@@ -43,7 +43,7 @@ function ContextMenu(params) { ...@@ -43,7 +43,7 @@ function ContextMenu(params) {
self._documentClickListener = function (e) { self._documentClickListener = function (e) {
var className = e.target.className; var className = e.target.className;
if (typeof className === 'string' || className instanceof String) { if (typeof className === 'string' || className instanceof String) {
if (className.indexOf("dropdown-link") === -1) { if (className.indexOf("dropdown-item") === -1) {
self.hide(new Date().getTime() - self.MIN_SHOW_TIME); self.hide(new Date().getTime() - self.MIN_SHOW_TIME);
} }
} else { } else {
...@@ -83,13 +83,12 @@ ContextMenu.prototype.addOption = function (name, handler, disabled) { ...@@ -83,13 +83,12 @@ ContextMenu.prototype.addOption = function (name, handler, disabled) {
}); });
var link = Functions.createElement({ var link = Functions.createElement({
type: "a", type: "a",
className: "dropdown-link", className: "dropdown-item",
href: "#",
content: name content: name
}); });
if (!disabled) { if (disabled) {
link.href = "#"; link.className = 'dropdown-item disabled';
} else {
link.className = 'disabled-link';
} }
$(link).data("handler", handler); $(link).data("handler", handler);
option.appendChild(link); option.appendChild(link);
......
...@@ -30,7 +30,7 @@ SubMenu.prototype._createGui = function (params) { ...@@ -30,7 +30,7 @@ SubMenu.prototype._createGui = function (params) {
var link = Functions.createElement({ var link = Functions.createElement({
type: "a", type: "a",
href: "#", href: "#",
className: "dropdown-link", className: "dropdown-item",
content: params.name content: params.name
}); });
link.tabIndex = -1; link.tabIndex = -1;
...@@ -55,7 +55,7 @@ SubMenu.prototype.addOption = function (name, handler) { ...@@ -55,7 +55,7 @@ SubMenu.prototype.addOption = function (name, handler) {
var link = Functions.createElement({ var link = Functions.createElement({
type: "a", type: "a",
href: "#", href: "#",
className: "dropdown-link", className: "dropdown-item",
content: name content: name
}); });
$(link).data("handler", handler); $(link).data("handler", handler);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment