- Widget dragging was broken when selecting the root
- sidepanel toggle doens't trig root selection in editor anymore
- Push/toggle style update
This commit is contained in:
jean-emmanuel 2016-03-10 10:59:04 +01:00
parent ac84dfcdc6
commit 5c3cbe0162
5 changed files with 10 additions and 12 deletions

File diff suppressed because one or more lines are too long

View file

@ -224,6 +224,10 @@ var editSession = function(container,data,refresh){
if (!refresh && $('.editor-root').hasClass('editing')) return
$('.widget.ui-resizable').resizable('destroy')
$('.widget.ui-draggable').draggable('destroy').find('.ui-draggable-handle').remove()
$('.editing').removeClass('editing')
$('.editor-root, #container').addClass('editing')

View file

@ -102,9 +102,9 @@ var sidepanel = function(data){
}(data)
var toggle = function(){
$(`<a id="open-toggle">${icon('navicon')}</a>`).appendTo('#container').click(function(){
$(`<a id="open-toggle">${icon('navicon')}</a>`).appendTo('#container').click(function(e){
$('#open-toggle, #sidepanel, #container').toggleClass('sidepanel-open')
})
}).on('mousedown touchstart',function(e){e.stopPropagation()})
// in case where are hot loading a session
if ($('#sidepanel').hasClass('sidepanel-open')) {

View file

@ -27,7 +27,6 @@ module.exports.create = function(widgetData,container) {
var widget = $(`
<div class="push toggle">
<div class="light"></div>
</div>\
`),
$document = $(document)
@ -59,10 +58,7 @@ module.exports.create = function(widgetData,container) {
var on = widgetData.on,
off= widgetData.off
if (v==on) {
widget.addClass('on').removeClass('ripple').addClass('ripple').delay(250).queue(function(next){
widget.removeClass('ripple')
next()
})
widget.addClass('on')
if (send) widget.sendValue(v)
} else if (v==off) {
widget.removeClass('on')

View file

@ -1055,7 +1055,6 @@ a {
top:4rem;
height:4rem;
background: $color-track;
border-radius: 3rem;
}
&.on .light {
background: $color-accent;
@ -1078,10 +1077,9 @@ a {
left:6rem;
right:6rem;
bottom:6rem;
border-radius:0;
height:auto;
}
&:active .light {
background: $color-accent;
opacity:.5;
}
}