本文整理汇总了Python中pyasm.web.HtmlElement.add_relay_behavior方法的典型用法代码示例。如果您正苦于以下问题:Python HtmlElement.add_relay_behavior方法的具体用法?Python HtmlElement.add_relay_behavior怎么用?Python HtmlElement.add_relay_behavior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.web.HtmlElement
的用法示例。
在下文中一共展示了HtmlElement.add_relay_behavior方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TopWdg
# 需要导入模块: from pyasm.web import HtmlElement [as 别名]
# 或者: from pyasm.web.HtmlElement import add_relay_behavior [as 别名]
#.........这里部分代码省略.........
if (!hit)
spt.body.focus_elements = [];
}
//bvr.src_el.addEvent("mousedown", spt.body.hide_focus_elements);
document.body.addEvent("mousedown", spt.body.hide_focus_elements);
'''
} )
web = WebContainer.get_web()
self.body.add_color("color", "color")
#if web.is_title_page():
# self.body.add_gradient("background", "background", 0, -20)
#else:
# self.body.add_gradient("background", "background", 0, -15)
self.body.add_color("background", "background")
self.body.add_style("background-attachment: fixed !important")
self.body.add_style("margin: 0px")
self.body.add_style("padding: 0px")
# ensure that any elements that force the default menu over any TACTIC right-click context menus has the
# 'force_default_context_menu' flag reset for the next right click that occurs ...
#
self.body.add_event( "oncontextmenu", "spt.force_default_context_menu = false;" )
def add_top_behaviors(self):
self.body.add_relay_behavior( {
'type': 'click',
'bvr_match_class': 'tactic_popup',
'cbjs_action': '''
var view = bvr.src_el.getAttribute("view");
if (!view) {
spt.alert("No view found");
}
var target = bvr.src_el.getAttribute("target");
var title = bvr.src_el.getAttribute("title");
var class_name = 'tactic.ui.panel.CustomLayoutWdg';
var kwargs = {
view: view,
}
var attributes = bvr.src_el.attributes;
for (var i = 0; i < attributes.length; i++) {
var name = attributes[i].name;
if (name == "class") {
continue;
}
var value = attributes[i].value;
kwargs[name] = value;
}
spt.panel.load_popup(title, class_name, kwargs);
'''
} )