Author: bklaas
Date: Thu Jan 28 15:16:26 2010
New Revision: 8419
URL: http://svn.slimdevices.com/jive?rev=8419&view=rev
Log:
r38...@daddymac-520 (orig r8418): bklaas | 2010-01-28 17:08:25 -0500
Fixed Bug: 14874
Description: allow support of an onClick tag on menu items to refresh the
current window, the parent window, or the grandparent window
Modified:
7.5/trunk/ (props changed)
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
Propchange: 7.5/trunk/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Thu Jan 28 15:16:26 2010
@@ -12,7 +12,7 @@
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/fab4-autoswitch:5831
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/fab4-skin:4552
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/private-branches/new-alsa:6567
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:8414
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:8418
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378
Modified:
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL:
http://svn.slimdevices.com/jive/7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=8419&r1=8418&r2=8419&view=diff
==============================================================================
---
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
(original)
+++
7.5/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
Thu Jan 28 15:16:26 2010
@@ -356,6 +356,15 @@
end
+local function _getGrandparentStep()
+ if #_stepStack < 3 then
+ return nil
+ end
+
+ return _stepStack[#_stepStack - 2]
+end
+
+
local function _getParentStep()
if #_stepStack < 2 then
return nil
@@ -969,6 +978,18 @@
end
end
+
+local function _refreshGrandparent()
+ local step = _getGrandparentStep()
+ if step then
+ local timer = Timer(100,
+ function()
+ _refreshJSONAction(step)
+ end, true)
+ timer:start()
+ end
+end
+
local function _refreshOrigin()
local step = _getParentStep()
@@ -1691,6 +1712,10 @@
local iNextWindow
--nextWindow on the action
local aNextWindow
+
+ -- onClick handler, for allowing refreshes of this window when
using a checkbox/radio/choice item (or 1 above, or 2 steps above)
+ local iOnClick
+ local bOnClick
-- we handle no action in the case of an item telling us not to
if item['action'] == 'none' then
@@ -1700,6 +1725,10 @@
-- dissect base and item for nextWindow params
bNextWindow = _safeDeref(chunk, 'base', 'nextWindow')
iNextWindow = item['nextWindow']
+
+ bOnClick = _safeDeref(chunk, 'base', 'onClick')
+ iOnClick = item['onClick']
+ local onClick = iOnClick or bOnClick -- item onClick wins over
base onClick
local useNextWindow
local actionHandlersExist = _safeDeref(item, 'actions') or
_safeDeref(chunk, 'base', 'actions')
@@ -1882,9 +1911,11 @@
else
_hideMeAndMyDad()
end
- elseif nextWindow == 'refreshOrigin' then
+ elseif onClick == 'refreshGrandparent' then
+ _refreshGrandparent()
+ elseif nextWindow == 'refreshOrigin' or onClick
== 'refreshOrigin' then
_refreshOrigin()
- elseif nextWindow == 'refresh' then
+ elseif nextWindow == 'refresh' or onClick ==
'refreshMe' then
_refreshMe()
-- if we have a nextWindow but none of those
reserved words above, hide back to that named window
elseif nextWindow then
_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/jive-checkins