|
152 | 152 |
|
153 | 153 | that._position(); |
154 | 154 |
|
155 | | - if (options.pinned) { |
156 | | - that.pin(true); |
157 | | - } |
158 | | - |
159 | 155 | if (content) { |
160 | 156 | that.refresh(content); |
161 | 157 | } |
|
185 | 181 |
|
186 | 182 | this._draggable(); |
187 | 183 |
|
| 184 | + if (options.pinned) { |
| 185 | + that.pin(); |
| 186 | + } |
| 187 | + |
188 | 188 | id = element.attr("id"); |
189 | 189 | if (id) { |
190 | 190 | id = id + "_wnd_title"; |
|
365 | 365 | }, |
366 | 366 |
|
367 | 367 | _actions: function() { |
368 | | - var actions = this.options.actions; |
| 368 | + var options = this.options; |
| 369 | + var actions = options.actions; |
| 370 | + var pinned = options.pinned; |
369 | 371 | var titlebar = this.wrapper.children(KWINDOWTITLEBAR); |
370 | 372 | var container = titlebar.find(".k-window-actions"); |
371 | 373 | var windowSpecificCommands = [ "maximize", "minimize" ]; |
372 | 374 |
|
373 | 375 | actions = $.map(actions, function(action) { |
| 376 | + action = !pinned && action.toLowerCase() === "pin" ? "unpin" : action; |
374 | 377 | return { name: (windowSpecificCommands.indexOf(action.toLowerCase()) > - 1) ? "window-" + action : action }; |
375 | 378 | }); |
376 | 379 |
|
|
544 | 547 | "k-i-window-minimize": "minimize", |
545 | 548 | "k-i-window-restore": "restore", |
546 | 549 | "k-i-refresh": "refresh", |
547 | | - "k-i-pin": "pin", |
548 | | - "k-i-unpin": "unpin" |
| 550 | + "k-i-pin": "unpin", |
| 551 | + "k-i-unpin": "pin" |
549 | 552 | }[iconClass]; |
550 | 553 | }, |
551 | 554 |
|
|
1058 | 1061 | return this.options.isMinimized; |
1059 | 1062 | }, |
1060 | 1063 |
|
1061 | | - pin: function(force) { |
| 1064 | + pin: function() { |
1062 | 1065 | var that = this, |
1063 | 1066 | win = $(window), |
1064 | 1067 | wrapper = that.wrapper, |
1065 | 1068 | top = parseInt(wrapper.css("top"), 10), |
1066 | 1069 | left = parseInt(wrapper.css("left"), 10); |
1067 | 1070 |
|
1068 | | - if (force || !that.options.pinned && !that.options.isMaximized) { |
| 1071 | + if (!that.options.isMaximized) { |
1069 | 1072 | wrapper.css({position: "fixed", top: top - win.scrollTop(), left: left - win.scrollLeft()}); |
1070 | | - wrapper.children(KWINDOWTITLEBAR).find(KPIN).addClass("k-i-unpin").removeClass("k-i-pin"); |
| 1073 | + wrapper.children(KWINDOWTITLEBAR).find(KUNPIN).addClass("k-i-pin").removeClass("k-i-unpin"); |
1071 | 1074 |
|
1072 | 1075 | that.options.pinned = true; |
| 1076 | + that.options.draggable = false; |
1073 | 1077 | } |
1074 | 1078 | }, |
1075 | 1079 |
|
|
1080 | 1084 | top = parseInt(wrapper.css("top"), 10), |
1081 | 1085 | left = parseInt(wrapper.css("left"), 10); |
1082 | 1086 |
|
1083 | | - if (that.options.pinned && !that.options.isMaximized) { |
| 1087 | + if (!that.options.isMaximized) { |
1084 | 1088 | wrapper.css({position: "", top: top + win.scrollTop(), left: left + win.scrollLeft()}); |
1085 | | - wrapper.children(KWINDOWTITLEBAR).find(KUNPIN).addClass("k-i-pin").removeClass("k-i-unpin"); |
| 1089 | + wrapper.children(KWINDOWTITLEBAR).find(KPIN).addClass("k-i-unpin").removeClass("k-i-pin"); |
1086 | 1090 |
|
1087 | 1091 | that.options.pinned = false; |
| 1092 | + that.options.draggable = true; |
1088 | 1093 | } |
1089 | 1094 | }, |
1090 | 1095 |
|
|
1483 | 1488 | actions = element.find(".k-window-actions"), |
1484 | 1489 | containerOffset = kendo.getOffset(wnd.appendTo); |
1485 | 1490 |
|
1486 | | - this._preventDragging = wnd.trigger(DRAGSTART); |
| 1491 | + this._preventDragging = wnd.trigger(DRAGSTART) || !wnd.options.draggable; |
1487 | 1492 | if (this._preventDragging) { |
1488 | 1493 | return; |
1489 | 1494 | } |
|
0 commit comments