update uses of focusInput()

This commit is contained in:
rolux 2011-12-18 15:14:11 +05:30
parent 4701245038
commit c1c4441b10
9 changed files with 21 additions and 17 deletions

View file

@ -486,7 +486,7 @@ Ox.ListCalendar = function(options, self) {
Ox.Log('Calendar', 'TIME TO SET LIST OPTIONS:', +new Date() - time0); Ox.Log('Calendar', 'TIME TO SET LIST OPTIONS:', +new Date() - time0);
self.$calendar.addEvent(event); self.$calendar.addEvent(event);
selectEvent(event); selectEvent(event);
self.$nameInput.focusInput(); self.$nameInput.focusInput(true);
} else { } else {
alert(result.status.text); alert(result.status.text);
} }

View file

@ -66,7 +66,7 @@ Ox.ArrayInput = function(options, self) {
} }
}) })
.appendTo(self.$element[index])); .appendTo(self.$element[index]));
focus && self.$input[index].focusInput(); focus && self.$input[index].focusInput(true);
self.$removeButton.splice(index, 0, Ox.Button({ self.$removeButton.splice(index, 0, Ox.Button({
title: self.$input.length == 1 ? 'close' : 'remove', title: self.$input.length == 1 ? 'close' : 'remove',
type: 'image' type: 'image'
@ -83,7 +83,7 @@ Ox.ArrayInput = function(options, self) {
}); });
} }
if (self.$input.length == 1) { if (self.$input.length == 1) {
self.$input[0].focusInput(); self.$input[0].focusInput(true);
} else { } else {
removeInput(index); removeInput(index);
} }

View file

@ -768,7 +768,7 @@ Ox.Input = function(options, self) {
if (self.options.value === '') { if (self.options.value === '') {
if (self.options.type == 'password') { if (self.options.type == 'password') {
self.$placeholder.hide(); self.$placeholder.hide();
self.$input.show().focusInput(); self.$input.show().focusInput(true);
} else { } else {
self.$input self.$input
.removeClass('OxPlaceholder') .removeClass('OxPlaceholder')
@ -1138,7 +1138,7 @@ Ox.Input_ = function(options, self) {
float: 'left' float: 'left'
}) })
.click(function() { .click(function() {
that.$input[0].focusInput(); that.$input[0].focusInput(true);
}) })
.appendTo(that); .appendTo(that);
} else if (key.label.length > 1) { } else if (key.label.length > 1) {
@ -1192,7 +1192,7 @@ Ox.Input_ = function(options, self) {
float: 'right' float: 'right'
}) })
.click(function() { .click(function() {
that.$input[0].focusInput(); that.$input[0].focusInput(true);
}) })
.appendTo(that); .appendTo(that);
} else if (self.options.unit.length > 1) { } else if (self.options.unit.length > 1) {
@ -1232,7 +1232,7 @@ Ox.Input_ = function(options, self) {
marginLeft: (v.width - (i == 0 ? 16 : 32)) + 'px' marginLeft: (v.width - (i == 0 ? 16 : 32)) + 'px'
}) })
.click(function() { .click(function() {
that.$input[0].focusInput(); that.$input[0].focusInput(true);
}) })
.appendTo(that); .appendTo(that);
} }
@ -1307,7 +1307,7 @@ Ox.Input_ = function(options, self) {
} }
if (self.options.label) { if (self.options.label) {
//that.$label.html(self.option.title); //that.$label.html(self.option.title);
that.$input[0].focusInput(); that.$input[0].focusInput(true);
//autocompleteCall(); //autocompleteCall();
} else { } else {
that.$input[0].options({ that.$input[0].options({
@ -1326,14 +1326,14 @@ Ox.Input_ = function(options, self) {
} }
function changeUnit() { function changeUnit() {
that.$input[0].focusInput(); that.$input[0].focusInput(true);
} }
function clear() { function clear() {
that.$input.forEach(function(v, i) { that.$input.forEach(function(v, i) {
v.val(''); v.val('');
}); });
that.$input[0].focusInput(); that.$input[0].focusInput(true);
} }
function height(value) { function height(value) {

View file

@ -89,7 +89,7 @@ Ox.InputGroup = function(options, self) {
if ($(event.target).hasClass('OxSeparator')) { if ($(event.target).hasClass('OxSeparator')) {
Ox.forEach(self.options.inputs, function($input) { Ox.forEach(self.options.inputs, function($input) {
if ($input.focusInput) { if ($input.focusInput) {
$input.focusInput(); $input.focusInput(true);
return false; return false;
} }
}); });

View file

@ -857,7 +857,7 @@ Ox.TextList = function(options, self) {
blur: submit, blur: submit,
}) })
.appendTo($cell); .appendTo($cell);
//.focusInput(); //.focusInput(true);
setTimeout($input.focusInput, 0); // fixme: strange setTimeout($input.focusInput, 0); // fixme: strange
function submit() { function submit() {
var value = $input.value(); var value = $input.value();

View file

@ -79,7 +79,7 @@ Ox.VideoEditor = function(options, self) {
}, },
key_f: function() { key_f: function() {
setTimeout(function() { setTimeout(function() {
self.$findInput.focusInput(); self.$findInput.focusInput(true);
}); });
}, },
key_g: function() { key_g: function() {
@ -1004,7 +1004,7 @@ Ox.VideoEditor = function(options, self) {
if (self.results.length) { if (self.results.length) {
setPosition(getNextPosition('result', 1)); setPosition(getNextPosition('result', 1));
} else { } else {
self.$findInput.focusInput(); self.$findInput.focusInput(true);
} }
} }
} }

View file

@ -1115,7 +1115,7 @@ Ox.VideoPlayer = function(options, self) {
if (self.$find.is(':hidden')) { if (self.$find.is(':hidden')) {
toggleFind(); toggleFind();
} else { } else {
self.$findInput.focusInput(); self.$findInput.focusInput(true);
} }
}, 0); }, 0);
} }
@ -1999,7 +1999,7 @@ Ox.VideoPlayer = function(options, self) {
results: self.results results: self.results
}); });
if (hasPressedEnter) { if (hasPressedEnter) {
self.results.length ? goToNextResult(1) : self.$findInput.focusInput(); self.results.length ? goToNextResult(1) : self.$findInput.focusInput(true);
} }
that.triggerEvent('find', {find: self.options.find}); that.triggerEvent('find', {find: self.options.find});
} }

View file

@ -664,6 +664,8 @@ Ox.sub <f> Returns a substring or sub-array
"ooba" "ooba"
> Ox.sub('foobar', -5, -1) > Ox.sub('foobar', -5, -1)
"ooba" "ooba"
> Ox.sub('foo', -1, 0)
""
@*/ @*/
Ox.sub = function(col, start, stop) { Ox.sub = function(col, start, stop) {
stop = Ox.isUndefined(stop) ? col.length : stop; stop = Ox.isUndefined(stop) ? col.length : stop;

View file

@ -96,7 +96,9 @@
@*/ @*/
Ox.decodeBase32 = function(str) { Ox.decodeBase32 = function(str) {
return parseInt(Ox.map(str.toUpperCase(), function(char) { return parseInt(Ox.map(str.toUpperCase(), function(char) {
var index = Ox.BASE_32_DIGITS.indexOf(Ox.BASE_32_ALIASES[char] || char); var index = Ox.BASE_32_DIGITS.indexOf(
Ox.BASE_32_ALIASES[char] || char
);
return (index == -1 ? ' ' : index).toString(32); return (index == -1 ? ' ' : index).toString(32);
}).join(''), 32); }).join(''), 32);
}; };