|
124 | 124 | } |
125 | 125 | }, |
126 | 126 |
|
127 | | - setOptions: function(options) { |
128 | | - var that = this; |
129 | | - |
130 | | - Widget.fn.setOptions.call(that, options); |
131 | | - |
132 | | - if (options.content) { |
133 | | - kendo.destroy(that.element.children()); |
134 | | - that.element.html(options.content); |
135 | | - } |
136 | | - |
137 | | - if (options.actions) { |
138 | | - that.wrapper.children(KBUTTONGROUP).remove(); |
139 | | - that._createActionbar(that.wrapper); |
140 | | - } |
141 | | - |
142 | | - that._closable(that.wrapper); |
143 | | - that._dimensions(); |
144 | | - |
145 | | - if (options.modal !== undefined) { |
146 | | - that._overlay(that.wrapper.is(VISIBLE)).css({ opacity: 0.5 }); |
147 | | - } |
148 | | - |
149 | | - if (options.title !== undefined) { |
150 | | - that.title(options.title); |
151 | | - } |
152 | | - }, |
153 | | - |
154 | 127 | _dimensions: function() { |
155 | 128 | var that = this, |
156 | 129 | wrapper = that.wrapper, |
|
321 | 294 | options = that.options, |
322 | 295 | isRtl = kendo.support.isRtl(content), |
323 | 296 | titlebar = $(templates.titlebar(options)), |
| 297 | + titlebarActions = titlebar.find(".k-window-actions"), |
324 | 298 | titleId = (content.id || kendo.guid()) + "_title", |
325 | 299 | wrapper = $(that.wrapperTemplate(options)); |
326 | 300 |
|
|
329 | 303 | content.addClass(KCONTENTCLASS); |
330 | 304 | that.appendTo.append(wrapper); |
331 | 305 |
|
| 306 | + if (options.closable !== false) { |
| 307 | + if (options.title !== false) { |
| 308 | + titlebarActions.append(templates.close(options)); |
| 309 | + } |
| 310 | + else { |
| 311 | + wrapper.append(templates.close(options)); |
| 312 | + } |
| 313 | + } |
| 314 | + |
332 | 315 | if (options.title !== false) { |
333 | 316 | wrapper.append(titlebar); |
334 | 317 | titlebar.attr("id", titleId); |
|
337 | 320 | wrapper.addClass(KTITLELESS); |
338 | 321 | } |
339 | 322 |
|
340 | | - that._closable(wrapper); |
341 | | - |
342 | 323 | wrapper.append(content); |
343 | 324 |
|
344 | 325 | if (options.content) { |
|
351 | 332 | } |
352 | 333 | }, |
353 | 334 |
|
354 | | - _closable: function (wrapper) { |
355 | | - var that = this; |
356 | | - var options = that.options; |
357 | | - var titlebar = wrapper.children(KDIALOGTITLEBAR); |
358 | | - var titlebarActions = titlebar.find(".k-window-actions"); |
359 | | - var closeAction = titlebarActions.length ? titlebarActions.find(".k-dialog-close") : wrapper.find(".k-dialog-close"); |
360 | | - |
361 | | - closeAction.remove(); |
362 | | - |
363 | | - if (options.closable !== false) { |
364 | | - if (options.title !== false) { |
365 | | - titlebarActions.append(templates.close(options)); |
366 | | - } |
367 | | - else { |
368 | | - wrapper.prepend(templates.close(options)); |
369 | | - } |
370 | | - } |
371 | | - }, |
372 | | - |
373 | 335 | _createActionbar: function(wrapper) { |
374 | 336 | var isStretchedLayout = (this.options.buttonLayout === "stretched"); |
375 | 337 | var buttonLayout = isStretchedLayout ? "stretched" : "normal"; |
|
0 commit comments