forked from 0x2620/oxjs
rather use ''.slice than ''.substr
This commit is contained in:
parent
f990f3b857
commit
1608664bb6
20 changed files with 69 additions and 71 deletions
|
|
@ -336,10 +336,10 @@ Ox.URL = function(options) {
|
|||
}
|
||||
if (['=', '!='].indexOf(condition.operator) > -1) {
|
||||
if (condition.value[0] == '*') {
|
||||
condition.value = condition.value.substr(1);
|
||||
condition.value = condition.value.slice(1);
|
||||
condition.operator = condition.operator.replace('=', '$')
|
||||
} else if (condition.value[condition.value.length - 1] == '*') {
|
||||
condition.value = condition.value.substr(0, condition.value.length - 1);
|
||||
condition.value = condition.value.slice(0, -1);
|
||||
condition.operator = condition.operator.replace('=', '^')
|
||||
}
|
||||
}
|
||||
|
|
@ -417,7 +417,7 @@ Ox.URL = function(options) {
|
|||
return str.split(',').map(function(str) {
|
||||
var hasOperator = /^[\+-]/.test(str);
|
||||
return {
|
||||
key: hasOperator ? str.substr(1) : str,
|
||||
key: hasOperator ? str.slice(1) : str,
|
||||
operator: hasOperator
|
||||
? str[0]
|
||||
: Ox.getObjectById(self.options.sortKeys[state.type][
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue