Skip to content

Commit 086ddb1

Browse files
committed
Updated dist and version.
1 parent 48eff23 commit 086ddb1

File tree

3 files changed

+29
-11
lines changed

3 files changed

+29
-11
lines changed

dist/utils.js

+26-8
Original file line numberDiff line numberDiff line change
@@ -1549,15 +1549,25 @@ FunctionUtil = {
15491549
{
15501550
var timeoutId;
15511551
return function() {
1552-
var args = arguments;
15531552
if (timeoutId) {
15541553
clearTimeout(timeoutId);
15551554
timeoutId = null;
15561555
}
1556+
var args = arguments;
15571557
timeoutId = setTimeout(function() {
15581558
func.apply(scope, args);
15591559
}, milliseconds);
15601560
};
1561+
/*
1562+
var timeoutId;
1563+
return function() {
1564+
if (timeoutId) {
1565+
timeoutId.cancel();
1566+
timeoutId = null;
1567+
}
1568+
timeoutId = FunctionUtil.delay.apply(null, [milliseconds, func, scope].concat(arguments));
1569+
};
1570+
*/
15611571
},
15621572

15631573
delay: function(milliseconds, func, scope)
@@ -1612,19 +1622,27 @@ FunctionUtil = {
16121622
{
16131623
var timeoutId;
16141624
return function() {
1615-
var args = arguments;
16161625
if (timeoutId) {
16171626
return;
1618-
} else {
1619-
func.apply(scope, args);
1620-
timeoutId = setTimeout(function() {
1621-
clearTimeout(timeoutId);
1622-
timeoutId = null;
1623-
}, milliseconds);
16241627
}
1628+
func.apply(scope, arguments);
1629+
timeoutId = setTimeout(function() {
1630+
clearTimeout(timeoutId);
1631+
timeoutId = null;
1632+
}, milliseconds);
16251633
};
16261634
},
16271635

1636+
until: function(milliseconds, func, scope)
1637+
{
1638+
var interval = FunctionUtil.repeat(50, function() {
1639+
if (func() === false) {
1640+
interval.cancel();
1641+
}
1642+
}, this);
1643+
return interval;
1644+
},
1645+
16281646
validate: function(argumentsObj)
16291647
{
16301648
// FunctionUtil.validate(arguments, 'number', 'string', ['string', 'undefined']);

0 commit comments

Comments
 (0)