fixes
This commit is contained in:
parent
b5491102ef
commit
3deb8a35bb
|
@ -25,7 +25,7 @@ EXECUTE stmt;
|
|||
SET @s = ( SELECT IF(
|
||||
(SELECT COUNT(*) FROM MontageLayouts WHERE Name='Freeform') > 0,
|
||||
"SELECT 'Freeform already in layouts'",
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'Freeform\', \'{"default":{"float":"left"}}\');'
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'Freeform\', \'{"default":{"float":"left","position":"relative"}}\');'
|
||||
) );
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
@ -33,7 +33,7 @@ EXECUTE stmt;
|
|||
SET @s = ( SELECT IF(
|
||||
(SELECT COUNT(*) FROM MontageLayouts WHERE Name='2 Wide') > 0,
|
||||
"SELECT '2 Wide already in layouts'",
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'2 Wide\', \'{"default":{"float":"left","width":"49%"}}\');'
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'2 Wide\', \'{"default":{"float":"left","position":"relative","width":"49%"}}\');'
|
||||
) );
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
@ -41,7 +41,7 @@ EXECUTE stmt;
|
|||
SET @s = ( SELECT IF(
|
||||
(SELECT COUNT(*) FROM MontageLayouts WHERE Name='3 Wide') > 0,
|
||||
"SELECT '3 Wide already in layouts'",
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'3 Wide\', \'{"default":{"float":"left","width":"33%"}}\');'
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'3 Wide\', \'{"default":{"float":"left","position":"relative","width":"33%"}}\');'
|
||||
) );
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
@ -49,7 +49,7 @@ EXECUTE stmt;
|
|||
SET @s = ( SELECT IF(
|
||||
(SELECT COUNT(*) FROM MontageLayouts WHERE Name='4 Wide') > 0,
|
||||
"SELECT '4 Wide already in layouts'",
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'4 Wide\', \'{"default":{"float":"left","width":"24.5%"}}\');'
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'4 Wide\', \'{"default":{"float":"left","position":"relative","width":"24.5%"}}\');'
|
||||
) );
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
|
@ -58,7 +58,7 @@ EXECUTE stmt;
|
|||
SET @s = ( SELECT IF(
|
||||
(SELECT COUNT(*) FROM MontageLayouts WHERE Name='5 Wide') > 0,
|
||||
"SELECT '5 Wide already in layouts'",
|
||||
"INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES ('5 Wide', '{\"default\":{\"float\":\"left\",\"width\":\"19%\"}}' );"
|
||||
'INSERT INTO MontageLayouts (`Name`,`Positions`) VALUES (\'5 Wide\', \'{"default":{"float":"left","position":"relative","width":"19%"}}\' );'
|
||||
) );
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
|
|
|
@ -268,6 +268,16 @@ function toGrid(value) {
|
|||
return Math.round(value / 80) * 80;
|
||||
}
|
||||
|
||||
function getOffset( el ) {
|
||||
var _x = 0;
|
||||
var _y = 0;
|
||||
while( el && !isNaN( el.offsetLeft ) && !isNaN( el.offsetTop ) ) {
|
||||
_x += el.offsetLeft - el.scrollLeft;
|
||||
_y += el.offsetTop - el.scrollTop;
|
||||
el = el.offsetParent;
|
||||
}
|
||||
return { top: _y, left: _x };
|
||||
}
|
||||
|
||||
// Makes monitorFrames draggable.
|
||||
function edit_layout(button) {
|
||||
|
@ -282,8 +292,11 @@ function edit_layout(button) {
|
|||
console.log("Error finding frame for " + monitor.id );
|
||||
continue;
|
||||
}
|
||||
var position = getOffset( monitor_frame );
|
||||
monitor_frame.css('float','none');
|
||||
monitor_frame.css('position','absolute');
|
||||
monitor_frame.css('top', position.top+'px' );
|
||||
monitor_frame.css('left', position.left+'px' );
|
||||
} // end foreach monitor
|
||||
|
||||
$j('#monitors .monitorFrame').draggable({
|
||||
|
|
Loading…
Reference in New Issue