瀏覽代碼

Popup#afterConfirm popup broke features like "Archiv Cards", "Upload Attachements" and so on -> fixed

Martin Filser 3 年之前
父節點
當前提交
fecb9cdb66
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 1 1
      client/components/cards/minicard.js
  2. 3 3
      client/lib/popup.js

+ 1 - 1
client/components/cards/minicard.js

@@ -55,7 +55,7 @@ BlazeComponent.extendComponent({
    */
   cardLabelsPopup(event) {
     if (this.find('.js-card-label:hover')) {
-      Popup.open("cardLabels")(event, this.currentData());
+      Popup.open("cardLabels")(event, {dataContextIfCurrentDataIsUndefined: this.currentData()});
     }
   },
 

+ 3 - 3
client/lib/popup.js

@@ -32,9 +32,9 @@ window.Popup = new (class {
     }
     /** opens the popup
      * @param evt the current event
-     * @param dataContextIfCurrentDataIsUndefined use this dataContext if this.currentData() is undefined
+     * @param options options (dataContextIfCurrentDataIsUndefined use this dataContext if this.currentData() is undefined)
      */
-    return function(evt, dataContextIfCurrentDataIsUndefined) {
+    return function(evt, options) {
       // If a popup is already opened, clicking again on the opener element
       // should close it -- and interrupt the current `open` function.
       if (self.isOpen()) {
@@ -71,7 +71,7 @@ window.Popup = new (class {
         title: self._getTitle(popupName),
         depth: self._stack.length,
         offset: self._getOffset(openerElement),
-        dataContext: (this && this.currentData && this.currentData()) || dataContextIfCurrentDataIsUndefined || this,
+        dataContext: (this && this.currentData && this.currentData()) || (options && options.dataContextIfCurrentDataIsUndefined) || this,
       });
 
       // If there are no popup currently opened we use the Blaze API to render