1
0
Fork 0
forked from 0x2620/oxjs

adding symbols

This commit is contained in:
rlx 2011-09-01 04:46:14 +00:00
commit 6da40d325c
9 changed files with 54 additions and 16 deletions

View file

@ -554,6 +554,11 @@ Ox.List = function(options, self) {
return Math.ceil(self.pageLength * (self.options.itemHeight + self.itemMargin) / self.rowLength);
}
function getPageLength(page) {
var mod = self.listLength % self.pageLength;
return page < self.pages - 1 || mod == 0 ? self.pageLength : mod;
}
function getPositionById(id) {
// fixme: is this really needed?
var pos = -1;
@ -679,11 +684,9 @@ Ox.List = function(options, self) {
self.$items[pos].appendTo(that.$content);
});
self.selected.length && scrollToPosition(self.selected[0]);
}
function getPageLength(page) {
var mod = self.listLength % self.pageLength;
return page < self.pages - 1 || mod == 0 ? self.pageLength : mod;
// that.triggerEvent('init', {items: self.options.items.length});
// fixme: do async lists need to trigger init?
// will this only be reached in async lists?
}
function loadPage(page, callback) {

View file

@ -422,7 +422,7 @@ Ox.TextList = function(options, self) {
} else if (format) {
value = Ox.isObject(format) ?
Ox['format' + Ox.toTitleCase(format.type)]
.apply(this, $.merge([value], format.args)) :
.apply(this, Ox.merge([value], format.args || [])) :
format(value, data);
} else if (Ox.isArray(value)) {
value = value.join(', ');

View file

@ -47,6 +47,7 @@ Ox.CollapsePanel = function(options, self) {
.html(self.options.title/*.toUpperCase()*/)
.appendTo($titlebar),
$extras;
if (self.options.extras.length) {
$extras = Ox.Element()
.addClass('OxExtras')
@ -55,6 +56,7 @@ Ox.CollapsePanel = function(options, self) {
$extra.appendTo($extras);
});
}
that.$content = Ox.Element()
.addClass('OxContent')
.appendTo(that);
@ -65,11 +67,13 @@ Ox.CollapsePanel = function(options, self) {
marginTop: -that.$content.height() + 'px'
});
}
function dblclickTitlebar(e) {
if (!$(e.target).hasClass('OxButton')) {
$switch.trigger('click');
}
}
function toggleCollapsed() {
var marginTop;
self.options.collapsed = !self.options.collapsed;
@ -81,6 +85,7 @@ Ox.CollapsePanel = function(options, self) {
collapsed: self.options.collapsed
});
}
/*@
setOption <f> setOption
(key, value) -> <u> set key to value
@ -101,5 +106,7 @@ Ox.CollapsePanel = function(options, self) {
marginTop: -that.$content.height()
});
};
return that;
};

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View file

@ -60,10 +60,11 @@
'center', 'zoom', 'grow', 'shrink', 'fill', 'fit',
'unmute', 'volumeUp', 'volumeDown', 'mute',
'undo', 'redo', 'unlock', 'lock',
'mount', 'unmount', 'sync',
'volume', 'mount', 'unmount', 'sync',
'info', 'warning', 'help',
'check', 'embed', 'bracket',
'delete', 'download', 'edit', 'find', 'flag', 'like',
'upload', 'download',
'click', 'delete', 'edit', 'find', 'flag', 'icon', 'like',
'publish', 'set', 'star', 'user', 'view', 'loading'
].forEach(function(symbol) {
var $symbol, src = 'svg/symbol' + Ox.toTitleCase(symbol) + '.svg';

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256">
<path d="M 64,32 l 128,0 a 32,32 0 0,1 32,32 l 0,128 a 32,32 0 0,1 -32,32 l -128,0 a 32,32 0 0,1 -32,-32 l 0,-128 a 32,32 0 0,1 32,-32" fill="none" stroke="#404040" stroke-width="32"/>
</svg>

After

Width:  |  Height:  |  Size: 261 B

View file

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256">
<g stroke="#404040" stroke-width="32">
<rect x="32" y="160" width="192" height="64" fill="none"/>
<path d="M 32,160 l 24,-128 144,0 24,128" fill="none"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 256 B