forked from 0x2620/oxjs
cleanup Resizebar; make tooltips in VideoEditor, VideoPanel and VideoTimelinePanel configurable
This commit is contained in:
parent
6433c31002
commit
926410d663
4 changed files with 36 additions and 33 deletions
|
|
@ -2,17 +2,17 @@
|
|||
/*@
|
||||
Ox.Resizebar <f> Resizebar
|
||||
options <o> Options object
|
||||
collapsed <b|false> inital collapse state
|
||||
collapsible <b|true> collapse state can be changed
|
||||
edge <s|left> edge
|
||||
elements <a|[]> elements of the bar
|
||||
orientation <s|horizontal> orientation, can be horizontal or vertical
|
||||
panel <o|null> panel object
|
||||
resizeable <b|true> can bar be resized
|
||||
resize <a|[]> array with possible sizes
|
||||
size <n|0> default size
|
||||
tooltip <b|s|false> tooltip or not
|
||||
self <o> Shared private variable
|
||||
collapsed <b|false> Inital collapse state
|
||||
collapsible <b|true> If true, can be collapsed/expanded
|
||||
edge <s|left> Edge
|
||||
elements <a|[]> Elements of the bar
|
||||
orientation <s|horizontal> Orientation ('horizontal' or 'vertical')
|
||||
panel <o|null> Panel object
|
||||
resizeable <b|true> If true, can be resized
|
||||
resize <a|[]> Array of sizes
|
||||
size <n|0> Default size
|
||||
tooltip <b|s|false> If true, display tooltip, if string, append it
|
||||
self <o> Shared private variable
|
||||
([options[, self]]) -> <o:Ox.Element> Resizebar object
|
||||
@*/
|
||||
Ox.Resizebar = function(options, self) {
|
||||
|
|
@ -28,7 +28,8 @@ Ox.Resizebar = function(options, self) {
|
|||
parent: null,
|
||||
resizable: true,
|
||||
resize: [],
|
||||
size: 0
|
||||
size: 0,
|
||||
tooltip: false
|
||||
})
|
||||
.options(options || {})
|
||||
.update({
|
||||
|
|
@ -70,8 +71,8 @@ Ox.Resizebar = function(options, self) {
|
|||
|
||||
function dragstart(data) {
|
||||
if (self.options.resizable && !self.options.collapsed) {
|
||||
self.drag = {
|
||||
startPos: data[self.clientXY],
|
||||
self.drag = {
|
||||
startPos: data[self.clientXY],
|
||||
startSize: self.options.size
|
||||
}
|
||||
}
|
||||
|
|
@ -158,25 +159,25 @@ Ox.Resizebar = function(options, self) {
|
|||
function reset() {
|
||||
if (self.options.resizable && !self.options.collapsed) {
|
||||
// fixme: silly, pass an option
|
||||
self.options.parent.reset(
|
||||
self.isLeftOrTop ? 0
|
||||
: self.options.parent.options('elements').length - 1
|
||||
);
|
||||
self.options.parent.reset(
|
||||
self.isLeftOrTop ? 0
|
||||
: self.options.parent.options('elements').length - 1
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
if (self.options.collapsible) {
|
||||
// fixme: silly, pass an option
|
||||
self.options.parent.toggle(
|
||||
self.isLeftOrTop ? 0
|
||||
: self.options.parent.options('elements').length - 1
|
||||
);
|
||||
self.options.collapsed = !self.options.collapsed;
|
||||
that.css({cursor: getCursor()});
|
||||
self.$tooltip && self.$tooltip.hide(function() {
|
||||
self.$tooltip.options({title: getTitle()});
|
||||
});
|
||||
self.options.parent.toggle(
|
||||
self.isLeftOrTop ? 0
|
||||
: self.options.parent.options('elements').length - 1
|
||||
);
|
||||
self.options.collapsed = !self.options.collapsed;
|
||||
that.css({cursor: getCursor()});
|
||||
self.$tooltip && self.$tooltip.hide(function() {
|
||||
self.$tooltip.options({title: getTitle()});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue