|
139 | 139 | that._createActionbar(that.wrapper); |
140 | 140 | } |
141 | 141 |
|
| 142 | + that._closable(that.wrapper); |
142 | 143 | that._dimensions(); |
143 | | - that._overlay(options.modal && that.wrapper.is(VISIBLE)).css({ opacity: 0.5 }); |
| 144 | + |
| 145 | + if (options.modal !== undefined) { |
| 146 | + that._overlay(that.wrapper.is(VISIBLE)).css({ opacity: 0.5 }); |
| 147 | + } |
144 | 148 |
|
145 | 149 | if (options.title !== undefined) { |
146 | 150 | that.title(options.title); |
|
317 | 321 | options = that.options, |
318 | 322 | isRtl = kendo.support.isRtl(content), |
319 | 323 | titlebar = $(templates.titlebar(options)), |
320 | | - titlebarActions = titlebar.find(".k-window-actions"), |
321 | 324 | titleId = (content.id || kendo.guid()) + "_title", |
322 | 325 | wrapper = $(that.wrapperTemplate(options)); |
323 | 326 |
|
|
326 | 329 | content.addClass(KCONTENTCLASS); |
327 | 330 | that.appendTo.append(wrapper); |
328 | 331 |
|
329 | | - if (options.closable !== false) { |
330 | | - if (options.title !== false) { |
331 | | - titlebarActions.append(templates.close(options)); |
332 | | - } |
333 | | - else { |
334 | | - wrapper.append(templates.close(options)); |
335 | | - } |
336 | | - } |
337 | | - |
338 | 332 | if (options.title !== false) { |
339 | 333 | wrapper.append(titlebar); |
340 | 334 | titlebar.attr("id", titleId); |
|
343 | 337 | wrapper.addClass(KTITLELESS); |
344 | 338 | } |
345 | 339 |
|
| 340 | + that._closable(wrapper); |
| 341 | + |
346 | 342 | wrapper.append(content); |
347 | 343 |
|
348 | 344 | if (options.content) { |
|
355 | 351 | } |
356 | 352 | }, |
357 | 353 |
|
| 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 | + |
358 | 373 | _createActionbar: function(wrapper) { |
359 | 374 | var isStretchedLayout = (this.options.buttonLayout === "stretched"); |
360 | 375 | var buttonLayout = isStretchedLayout ? "stretched" : "normal"; |
|
0 commit comments