You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -80,6 +84,9 @@ class CUI.Modal extends CUI.LayerPane
80
84
check:"PlainObject"
81
85
onToggleFillScreen:
82
86
check:Function
87
+
# custom buttons to add to the header
88
+
header_buttons:
89
+
check:Array
83
90
84
91
@mergeOpt"placement",
85
92
default:"c"
@@ -106,6 +113,18 @@ class CUI.Modal extends CUI.LayerPane
106
113
@append(btn, "header_right")
107
114
return btn
108
115
116
+
__addCustomHeaderButton: (_btn) ->
117
+
ifCUI.util.isPlainObject(_btn)
118
+
btn=newCUI.defaults.class.Button(_btn)
119
+
else
120
+
btn= _btn
121
+
122
+
CUI.util.assert(btn instanceofCUI.Button, "Modal.__addCustomHeaderButton", "Button needs to be instance of Button", btn: btn)
123
+
CUI.util.assert(@__paneinstanceofCUI.SimplePane, "new #{@__cls}", "opts.header_buttons can only be used if opts.pane is instance of SimplePane.", pane:@__pane, opts:@opts)
124
+
125
+
@append(btn, "header_right")
126
+
return btn
127
+
109
128
__runOnAllButtons: (func) ->
110
129
for el inCUI.dom.matchSelector(@__layer.DOM, ".cui-button,.cui-data-field")
0 commit comments