From 935b1da0d0e7a0f43f0f53abab800b821e797b57 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 11 May 2024 16:50:07 +0800 Subject: [PATCH] bugfix --- bricks/bricks.js | 9 +++++---- examples/button.ui | 2 ++ examples/tabular.ui | 1 - examples/text.ui | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/bricks/bricks.js b/bricks/bricks.js index 5941732..cb61f7c 100755 --- a/bricks/bricks.js +++ b/bricks/bricks.js @@ -348,14 +348,15 @@ bricks.buildScriptHandler = function(w, target, rtdata, desc){ return f.bind(target, target, params); } bricks.buildDispatchEventHandler = function(w, target, rtdata, desc){ + var f = function(target, event_name, params, event){ + console.log('target=', target, 'event_name=', event_name, 'params=', params, 'Arguments=', arguments); + target.dispatch(event_name, params); + } var params = {}; bricks.extend(params, desc.params) bricks.extend(params, rtdata); params = bricks.apply_data(params, rtdata); - var f = function(target, event_name, params){ - target.dispatch(event_name, params); - } - return f.bind(target, params); + return f.bind(target, target, desc.dispatch_event, params); } bricks.getWidgetById = function(id, from_widget){ diff --git a/examples/button.ui b/examples/button.ui index 5923b10..eea2a11 100644 --- a/examples/button.ui +++ b/examples/button.ui @@ -13,6 +13,8 @@ "icon":"/bricks/imgs/submit.png", "label":"test once", "tooltip":"This is a joke too", + "bgcolor":"#ff00ff", + "color":"#ffffff", "nonepack":true, "orientation":"horizontal" } diff --git a/examples/tabular.ui b/examples/tabular.ui index 12d7145..af4bb87 100644 --- a/examples/tabular.ui +++ b/examples/tabular.ui @@ -2,7 +2,6 @@ "widgettype":"Tabular", "options":{ "data_url":"{{entire_url('./channels.dspy')}}", - "content_url":"{{entire_url('play_channel.dspy')}}", "content_view":{ "id":"videoplayer", "widgettype":"Iframe", diff --git a/examples/text.ui b/examples/text.ui index 21731b4..467f2f7 100644 --- a/examples/text.ui +++ b/examples/text.ui @@ -8,6 +8,8 @@ "widgettype":"Title1", "options":{ "text":"Pic Viewer", + "color":"#ff0000", + "bgcolor":"#00ffff", "dynsize":true, "i18n":true }