aralejs / popup Goto Github PK
View Code? Open in Web Editor NEW可触发的浮层组件。
Home Page: http://spmjs.io/docs/arale-popup/
可触发的浮层组件。
Home Page: http://spmjs.io/docs/arale-popup/
看到了范例中的“多个 Trigger 共享一个实例”:
seajs.use(['arale/popup/1.1.6/popup'], function(Popup){
new Popup({
trigger: '.trigger-all',
element: '#popup1',
effect: 'fade'
});
});
其中的“element”不能是css class吗?这样的话做简单的导航下拉菜单应该不错。
触摸设备 triggerType: 'hover' 的时候有问题
这个功能还是挺需要的
// 判断何时 trigger 为不响应事件的情况
ifTriggerDisabled: function() {
var n = this.trigger[0];
return (n.tagName === 'INPUT' && n.disabled);
}
能否支持传入window,使其可以在iframe下使用!
如题,如果设置triggerType为focus,无法用鼠标选择element的内容(因为鼠标选择时已经触发blur事件,element就关闭了)
当 popup 使用了委托事件时。
对于 1.1.2
版本。
new Popup({
trigger: '.trigger',
element: '#element',
delegateNode: '.content'
});
.content
里后续新添加的 .trigger
节点都能有 popup 的效果,但是 blurHide
这一属性只在初始化时绑定了,所以点击新的节点时,会导致浮层消失。
用例:https://github.com/aralejs/popup/blob/master/tests/popup-spec.js#L294
传入一层选择器 Okay 的,如:.trigger-element。
但如果传入多级选择器,不能使用,如:#wrap .trigger-element。
当然,可以设定 delegateNode 配合 element 解决问题,但是极易误导使用者。
求修复,要重现 demo 请联系我。
环境:Mac 10.8 + Chrome 28
Popup版本:1.1.3
使用Popup.extend,并指定template属性时,由于_onRenderVisible第一次渲染动画初始状态时,元素还没有append到body上,导致第一次展开时无动画效果。
指定element为页面上已存在的元素时,不存在这个问题。
https://github.com/aralejs/popup/blob/1.0.2/src/popup.js#L106
导致例如 trigger 为 checkbox 时,无法勾选上。
http://aralejs.org/docs/getting-started.html
aeales的Getting Started页面中popup的版本号要升级了,现在是0.9.9,0.9.8下载会失败
另外首页上的搜索功能也不可用
由于使用代码调用show
方法,此时就没有this.activeTrigger
,这样基准元素没有被正确赋值,导致定位错误。
解决方案:setup
时,默认将this.activeTrigger
设为this.get('trigger')
的第一个元素。
需要 widget 调整 #171
根据这个issue所说,base将在1.1.0版本中去除对 afterXxx,beforeXxx 接口的支持
希望在 popup 组件内部中增加相应接口的设计,因为 afterShow/beforeHide
之类的已经大规模的在实际场景中使用了
kissy 弹出层Overlay.Popup,怎么绑定class
trigger为class时,怎么样才能使弹出层跟随当前class浮动
从tip widget那里看过来,看到tip的config配置的时候,传了align的参数,但没弄懂是什么含义....popup这里可以增加一些关于align的帮助介绍吧?
这应该算个bug吧
更极端的情况下,如果select的option很多,select的大小超出了popup本身的大小,当点击某个option之后,可能鼠标已经在popup之外了,这时popup是该隐藏还是显示呢?
导致定位失败。
在 0.9.13 中进行修复。
effect: 'fade | slide'
widget基类扩展出来的组件,凡是在element及其内部的dom事件绑定,都可以通过this.delegateEvents()
方法来进行,对比用原生的 this.element.xxx()
有下面几个好处:
使用的是 事件代理 方式绑定,更利于性能及维护
当然这个事件代理是由jQuery来保证的
能保证handle里的context为 this
在destory的时候统一做事件销毁
所以按照上面的说法,代码里有2个地方可以修改
this.element.on('mousedown', function(e) {
that._downOnElement = true;
});
可以改成
this.delegateEvents('mousedown', function(e) {
this._downOnElement = true;
});
this.element.hover
这个的修改要测试一下,看看jQuery是否支持$('xxx').on('hover', function(){})
的形式了 :)
当 element 显示出来时,点击触发其他的 trigger ,无法正确显示 element。
需求来自:aralejs/aralejs.github.io#251
var popup = new Popup({
trigger: '.action',
delegateNode: 'table'
});
我想实现鼠标鼠标移上去,能显示内容的详细信息
怎么在实例时候获取trigger的innerhtml
多个trigger,若element已经显示,切换trigger时element不能正常显示,效果是先显示一下再隐藏掉了,triggerType: 'focus' 才会是这样,click 和 focus不会。
具体使用场景,为什么要这个字段等等,第一次看的话可能不太容易理解。
this.activeTrigger = this.get('trigger')[0];
应改为
this.activeTrigger = this.get('trigger').eq(0);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.