]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/debian/missing-sources/framework/Web/Javascripts/source/tinymce-405/classes/ui/ResizeHandle.js
baculum: Add missing-sources directory in debian metadata structure
[bacula/bacula] / gui / baculum / debian / missing-sources / framework / Web / Javascripts / source / tinymce-405 / classes / ui / ResizeHandle.js
1 /**
2  * ResizeHandle.js
3  *
4  * Copyright, Moxiecode Systems AB
5  * Released under LGPL License.
6  *
7  * License: http://www.tinymce.com/license
8  * Contributing: http://www.tinymce.com/contributing
9  */
10
11 /**
12  * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events.
13  *
14  * @-x-less ResizeHandle.less
15  * @class tinymce.ui.ResizeHandle
16  * @extends tinymce.ui.Widget
17  */
18 define("tinymce/ui/ResizeHandle", [
19         "tinymce/ui/Widget",
20         "tinymce/ui/DragHelper"
21 ], function(Widget, DragHelper) {
22         "use strict";
23
24         return Widget.extend({
25                 /**
26                  * Renders the control as a HTML string.
27                  *
28                  * @method renderHtml
29                  * @return {String} HTML representing the control.
30                  */
31                 renderHtml: function() {
32                         var self = this, prefix = self.classPrefix;
33
34                         self.addClass('resizehandle');
35
36                         if (self.settings.direction == "both") {
37                                 self.addClass('resizehandle-both');
38                         }
39
40                         self.canFocus = false;
41
42                         return (
43                                 '<div id="' + self._id + '" class="' + self.classes() + '">' +
44                                         '<i class="' + prefix + 'ico ' + prefix + 'i-resize"></i>' +
45                                 '</div>'
46                         );
47                 },
48
49                 /**
50                  * Called after the control has been rendered.
51                  *
52                  * @method postRender
53                  */
54                 postRender: function() {
55                         var self = this;
56
57                         self._super();
58
59                         self.resizeDragHelper = new DragHelper(this._id, {
60                                 start: function() {
61                                         self.fire('ResizeStart');
62                                 },
63
64                                 drag: function(e) {
65                                         if (self.settings.direction != "both") {
66                                                 e.deltaX = 0;
67                                         }
68
69                                         self.fire('Resize', e);
70                                 },
71
72                                 end: function() {
73                                         self.fire('ResizeEnd');
74                                 }
75                         });
76                 }
77         });
78 });