diff --git a/html/ajax_dash.php b/html/ajax_dash.php
index ec88e68eca..893de7a1c7 100644
--- a/html/ajax_dash.php
+++ b/html/ajax_dash.php
@@ -28,7 +28,7 @@ if (!$_SESSION['authenticated']) {
$type = mres($_POST['type']);
if ($type == 'placeholder') {
- $output = 'Please add a Widget to get started';
+ $output = "
Click on Edit-Dashboard to add Widgets
Remember: You can only move & rezise widgets when you're in Edit-Mode.
";
$status = 'ok';
$title = 'Placeholder';
}
diff --git a/html/pages/front/tiles.php b/html/pages/front/tiles.php
index a3669f5598..8d8b1f0110 100644
--- a/html/pages/front/tiles.php
+++ b/html/pages/front/tiles.php
@@ -41,7 +41,7 @@ foreach (dbFetchRows('SELECT user_widget_id,users_widgets.widget_id,title,widget
$data[] = $items;
}
if (empty($data)) {
- $data[] = array('user_widget_id'=>'0','widget_id'=>1,'title'=>'Add a widget','widget'=>'placeholder','col'=>1,'row'=>1,'size_x'=>2,'size_y'=>2,'refresh'=>60);
+ $data[] = array('user_widget_id'=>'0','widget_id'=>1,'title'=>'Add a widget','widget'=>'placeholder','col'=>1,'row'=>1,'size_x'=>6,'size_y'=>2,'refresh'=>60);
}
$data = serialize(json_encode($data));
$dash_config = unserialize(stripslashes($data));
@@ -86,9 +86,9 @@ if (!empty($shared_dashboards)) {
?>
-
-
-
+
+
+
@@ -229,7 +229,10 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
});
}
+ var gridster_state = 0;
+
$(function(){
+ $('[data-toggle="tooltip"]').tooltip();
dashboard_collapse();
gridster = $(".gridster ul").gridster({
widget_base_dimensions: [100, 100],
@@ -260,9 +263,25 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
}).data('gridster');
gridster.remove_all_widgets();
+ gridster.disable();
+ gridster.disable_resize();
$.each(serialization, function() {
widget_dom(this);
});
+ $(document).on('click','.edit-dash-btn', function() {
+ if (gridster_state == 0) {
+ gridster.enable();
+ gridster.enable_resize();
+ gridster_state = 1;
+ $('.fade-edit').fadeIn();
+ }
+ else {
+ gridster.disable();
+ gridster.disable_resize();
+ gridster_state = 0;
+ $('.fade-edit').fadeOut();
+ }
+ });
$(document).on('click','#clear_widgets', function() {
var widget_id = $(this).data('widget-id');
@@ -330,7 +349,7 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
});
$(document).on("click",".edit-widget",function() {
- obj = $(this).parent().parent();
+ obj = $(this).parent().parent().parent();
if( obj.data('settings') == 1 ) {
obj.data('settings','0');
} else {
@@ -347,6 +366,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
$(this).fadeOut(0);
});
$(target).fadeToggle(300);
+ if (target != "#edit_dash") {
+ gridster.disable();
+ gridster.disable_resize();
+ gridster_state = 0;
+ $('.fade-edit').fadeOut();
+ }
} else {
$('.dash-collapse').fadeOut(0);
}
@@ -418,9 +443,12 @@ foreach (dbFetchRows("SELECT * FROM `widgets` ORDER BY `widget_title`") as $widg
function widget_dom(data) {
dom = ''+
- '