Explorar o código

Fix django 1.10 lookups

Denis K %!s(int64=8) %!d(string=hai) anos
pai
achega
0a93e7b91a
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      jet/static/jet/js/src/features/related-popups.js

+ 13 - 0
jet/static/jet/js/src/features/related-popups.js

@@ -212,6 +212,18 @@ RelatedPopups.prototype = {
             self.closePopup();
         }).removeAttr('onclick');
     },
+    initLookupLinks: function() {
+        var self = this;
+
+        $("a[data-popup-opener]").click(function(e) {
+            e.preventDefault();
+
+            self.closePopup({
+                action: 'lookup',
+                value: $(this).data("popup-opener")
+            });
+        });
+    },
     run: function() {
         this.windowStorage.push(window);
 
@@ -221,6 +233,7 @@ RelatedPopups.prototype = {
             this.findPopupResponse();
             this.overrideRelatedGlobals();
             this.initDeleteRelatedCancellation();
+            this.initLookupLinks();
         } catch (e) {
             console.error(e, e.stack);
         }