summaryrefslogtreecommitdiff
path: root/assets/js/src
diff options
context:
space:
mode:
Diffstat (limited to 'assets/js/src')
-rw-r--r--assets/js/src/App.js12
-rw-r--r--assets/js/src/Popover.js10
2 files changed, 17 insertions, 5 deletions
diff --git a/assets/js/src/App.js b/assets/js/src/App.js
index 62e091fc..3fe75640 100644
--- a/assets/js/src/App.js
+++ b/assets/js/src/App.js
@@ -42,7 +42,17 @@ Kanboard.App.prototype.keyboardShortcuts = function() {
// Submit form
Mousetrap.bindGlobal("mod+enter", function() {
- $("form").submit();
+ var forms = $("form");
+
+ if (forms.length == 1) {
+ forms.submit();
+ } else if (forms.length > 1) {
+ if (document.activeElement.tagName === 'INPUT' || document.activeElement.tagName === 'TEXTAREA') {
+ $(document.activeElement).parents("form").submit();
+ } else if (self.get("Popover").isOpen()) {
+ $("#popover-container form").submit();
+ }
+ }
});
// Open board selector
diff --git a/assets/js/src/Popover.js b/assets/js/src/Popover.js
index 705a035a..216d6bf5 100644
--- a/assets/js/src/Popover.js
+++ b/assets/js/src/Popover.js
@@ -45,10 +45,12 @@ Kanboard.Popover.prototype.isOpen = function() {
Kanboard.Popover.prototype.open = function(link) {
var self = this;
- $.get(link, function(content) {
- $("body").prepend('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
- self.executeOnOpenedListeners();
- });
+ if (!self.isOpen()) {
+ $.get(link, function(content) {
+ $("body").prepend('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
+ self.executeOnOpenedListeners();
+ });
+ }
};
Kanboard.Popover.prototype.close = function(e) {