From 890515212617973574f5b121c54bea746cde3c40 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 2 Sep 2018 00:12:08 +0300 Subject: [PATCH] minor fixes... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/core.js | 13 ++++++++++--- ui (gen4)/features/examples.js | 5 ++--- ui (gen4)/package-lock.json | 6 +++--- ui (gen4)/package.json | 2 +- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index ba5e3e52..f4852287 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -849,6 +849,11 @@ module.Cache = ImageGridFeatures.Feature({ // Create a debounced action... // +// debounce() +// debounce(, ) +// debounce(, ) +// -> function +// // options format: // { // timeout: number, @@ -860,8 +865,9 @@ var debounce = module.debounce = function(options, func){ // parse args... - func = options instanceof Function ? options : func - options = options instanceof Function ? {} : options + var args = [...arguments] + func = args.pop() + options = args.pop() || {} if(typeof(options) == typeof(123)){ options.timeout = options @@ -903,7 +909,8 @@ function(options, func){ } f.toString = function(){ - return `// debounced...\n${doc([func.toString()])}` + return `// debounced...\n${ + doc([ func instanceof Function ? func.toString() : func ])}` } return f diff --git a/ui (gen4)/features/examples.js b/ui (gen4)/features/examples.js index 8bacab36..59b668a9 100755 --- a/ui (gen4)/features/examples.js +++ b/ui (gen4)/features/examples.js @@ -59,9 +59,8 @@ var ExampleActions = actions.Actions({ console.log(' <', args) return args })], - - testDebounce: ['Test/', - core.debounce(1000, 'exampleAction: ... -- docs...')], + exampleAliasDebounced: ['Test/', + core.debounce(1000, 'exampleAction: ...')], // a normal method... exampleMethod: function(){ diff --git a/ui (gen4)/package-lock.json b/ui (gen4)/package-lock.json index 8e64c1df..64c37613 100755 --- a/ui (gen4)/package-lock.json +++ b/ui (gen4)/package-lock.json @@ -1141,9 +1141,9 @@ "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" }, "ig-actions": { - "version": "3.20.1", - "resolved": "https://registry.npmjs.org/ig-actions/-/ig-actions-3.20.1.tgz", - "integrity": "sha512-eLQBRwHE+XSkYBbxH15cDIzPbVX8mMoyROyLe9HsEQCiX4bCAsyHRI+Gh6i3f30PyI4evTxHPSI+WiGZXXZGMA==", + "version": "3.20.2", + "resolved": "https://registry.npmjs.org/ig-actions/-/ig-actions-3.20.2.tgz", + "integrity": "sha512-B6tyFOgtg+9Pks8rtq0BgnDsU2kUbRm56/fCEOTeozCanl9Lm7atiKFa5ZonglzDdMLZpiXffLYW0vbYVgy9zw==", "requires": { "ig-object": "^1.0.7" } diff --git a/ui (gen4)/package.json b/ui (gen4)/package.json index bf65369a..948dea67 100755 --- a/ui (gen4)/package.json +++ b/ui (gen4)/package.json @@ -26,7 +26,7 @@ "fs-walk": "^0.0.1", "glob": "^4.0.6", "guarantee-events": "^1.0.0", - "ig-actions": "^3.20.1", + "ig-actions": "^3.20.2", "ig-features": "^3.3.4", "ig-object": "^1.0.7", "moment": "^2.22.2",