Author: bklaas
Date: Wed Aug 20 12:31:58 2008
New Revision: 2873

URL: http://svn.slimdevices.com?rev=2873&root=Jive&view=rev
Log:
Bug: 8169
Description: Allow single item SlimBrowse return data to render a TextArea and 
not a menu if textArea parameter is sent with item.

Modified:
    
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua

Modified: 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL: 
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=2873&root=Jive&r1=2872&r2=2873&view=diff
==============================================================================
--- 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 (original)
+++ 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 Wed Aug 20 12:31:58 2008
@@ -640,6 +640,22 @@
        _updatingPlayerPopup = popup
 end
 
+-- _renderTextArea
+-- special case when single SlimBrowse item is a textarea
+local function _renderTextArea(step, item)
+
+       if not step and step.window then
+               return
+       end
+       _assert(item)
+       _assert(item.textArea)
+
+       local textArea = Textarea("textarea", item.textArea)
+       step.window:addWidget(textArea)
+
+end
+
+
 -- _renderSlider
 -- special case when SlimBrowse item is configured for a slider widget
 local function _renderSlider(step, item)
@@ -888,12 +904,18 @@
                        end
                        local textArea = Textarea("textarea", 
data.window.textArea)
                        step.window:addWidget(textArea)
-               elseif step.menu and data and data.count and data.count == 1 
and data.item_loop and data.item_loop[1].slider then
+               elseif step.menu and data and data.count and data.count == 1 
and data.item_loop and (data.item_loop[1].slider or data.item_loop[1].textArea) 
then
                        -- no menus here, thankyouverymuch
                        if step.menu then
                                step.window:removeWidget(step.menu)
                        end
-                       _renderSlider(step, data.item_loop[1])
+
+                       if data.item_loop[1].slider then
+                               _renderSlider(step, data.item_loop[1])
+                       else
+                               _renderTextArea(step, data.item_loop[1])
+                       end
+
                -- avoid infinite request loop on count == 0
                elseif step.menu and data and data.count and data.count == 0 
then
                        -- this will render a blank menu, which is typically 
undesirable 

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to