add widget resizing via jquery-ui-resizable in editor, fixed horizontal fader style (vertical centering)

This commit is contained in:
bordun 2016-02-13 17:12:44 +01:00
parent 56d30a411f
commit 0a985ff3c6
5 changed files with 38 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -29,12 +29,14 @@ enableEditor = function(){
e.preventDefault()
e.stopPropagation()
var container = $(this),
parent = container.parent(),
index = container.index(),
data = getdata(container),
form = $('<div class="form"></div>')
$('.editing').removeClass('editing')
container.addClass('editing')
@ -54,9 +56,19 @@ enableEditor = function(){
newContainer.children().first().click()
$('#sidepanel').scrollTop(scroll)
}
$('.widget.ui-resizable').resizable('destroy')
$(this).resizable({
handles:'se',
helper: "resizable-helper",
stop: function( event, ui ) {
data.height = ui.size.height
data.width = ui.size.width
updateWidget()
}
})
for (i in data) {
if (i!='widgets' && i!='tabs') {
var type = typeof data[i],

View file

@ -11,6 +11,7 @@ window.$ = window.jQuery = require('./jquery/jquery.min.js')
require('./jquery/jquery.sortable.js')
require('./jquery/jquery.drag.js')
require('./jquery/jquery.resize.js')
require('./jquery/jquery.resizable.js')
// main js
require('./app/app.js')

File diff suppressed because one or more lines are too long

View file

@ -678,6 +678,21 @@ a {
}
}
.ui-resizable-handle {
position: absolute;
bottom: 5rem;
right: 5rem;
width:15rem;
height:15rem;
border-right: 2rem solid $color-accent;
border-bottom: 2rem solid $color-accent;
z-index: 100000;
cursor: se-resize;
}
.resizable-helper {
border: 1rem dashed $color-accent;
}
/* STRIP (contains any widgets) */
@ -1243,12 +1258,14 @@ a {
position: relative;
top:auto;
padding-bottom: 35rem;
height: 100%;
.fader-wrapper {
padding:20rem 20rem 50rem;
}
.fader {
width:100%;
left:auto;
top:50%;
height:4rem;
.handle {
height:100%!important;