mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-03 19:49:02 +00:00
95_Dashboard: the fhem root url is not hardcoded any more
but read from the variable. Fixed a problem that causes drag&drop being still activated when the dashboard was locked. (resize/move) git-svn-id: https://svn.fhem.de/fhem/trunk@9952 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
518320520d
commit
62256ccd7a
@ -1,5 +1,9 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 95_Dashboard: the fhem root url is not hardcoded any more
|
||||
but read from the $FW_ME variable.
|
||||
Fixed a problem that causes drag&drop being still activated
|
||||
when the dashboard was locked. (resize/move)
|
||||
- bugfix: 14_SD_WS07 - corrected syntax error and raised loglevels
|
||||
- bugfix: 55_GDS.pm - correct wrong cumulation in alerts (1st try)
|
||||
- feature: new module 10_DUOFERNSTICK and 30_DUOFERN added
|
||||
|
@ -477,6 +477,9 @@ sub Dashboard_SummaryFN($$$$)
|
||||
|
||||
################################
|
||||
################################
|
||||
|
||||
############################ Set FHEM url to avoid hardcoding it in javascript ############################
|
||||
$ret .= "<script type='text/javascript'>var fhemUrl = '" . $FW_ME . "';</script>";
|
||||
|
||||
$ret .= "<div id=\"tabEdit\" class=\"dashboard-dialog-content dashboard-widget-content\" title=\"Dashboard-Tab\" style=\"display:none;\">\n";
|
||||
$ret .= " <div id=\"dashboard-dialog-tabs\" class=\"dashboard dashboard_tabs\">\n";
|
||||
@ -509,7 +512,7 @@ sub Dashboard_SummaryFN($$$$)
|
||||
$ret .= "<input type=\"$debugfield\" size=\"100%\" id=\"dashboard_jsdebug\" value=\"\">\n";
|
||||
$ret .= "</div></td></tr>\n";
|
||||
$ret .= "<tr><td><div id=\"dashboardtabs\" class=\"dashboard dashboard_tabs\" style=\"background: " . ($backgroundimage ? "url(/fhem/images/" . FW_iconPath($backgroundimage) . ")" : "") . " no-repeat !important;\">\n";
|
||||
|
||||
|
||||
########################### Dashboard Tab-Liste ##############################################
|
||||
$ret .= " <ul id=\"dashboard_tabnav\" class=\"dashboard dashboard_tabnav dashboard_tabnav_".$showbuttonbar."\">\n";
|
||||
for (my $i=0;$i<$tabcount;$i++){$ret .= " <li class=\"dashboard dashboard_tab dashboard_tab_".$showbuttonbar."\"><a href=\"#dashboard_tab".$i."\">".trim($tabnames[$i])."</a></li>";}
|
||||
@ -817,7 +820,7 @@ sub BuildGroup
|
||||
|
||||
$row++;
|
||||
|
||||
$extPage{group} = $groupname;
|
||||
$extPage{group} = $groupname;
|
||||
my ($allSets, $cmdlist, $txt) = FW_devState($d, $rf, \%extPage);
|
||||
$allSets = FW_widgetOverride($d, $allSets);
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
var DashboardConfigHash = {};
|
||||
var dashboard_buttonbar = "top";
|
||||
var DashboardDraggable = true;
|
||||
var fhemUrl = '/fhem';
|
||||
|
||||
/* evol.colorpicker 2.2
|
||||
(c) 2014 Olivier Giulieri
|
||||
@ -318,27 +317,19 @@ function dashboard_get_params() {
|
||||
return dashboard_get_params.dashboard_params;
|
||||
}
|
||||
|
||||
function dashboard_setlock(){
|
||||
function dashboard_setlock(iTabIndex){
|
||||
if(is_dashboard_flexible()) {
|
||||
$( ".dashboard_widget" ).draggable( "option", "disabled", true );
|
||||
$( "#dashboard_tab" + iTabIndex + " .dashboard_column" ).draggable( "destroy");
|
||||
}
|
||||
else {
|
||||
$( ".dashboard_column" ).sortable( "option", "disabled", true );
|
||||
$( "#dashboard_tab" + iTabIndex + " .dashboard_column" ).sortable( "destroy");
|
||||
}
|
||||
$( ".dashboard_widget" ).removeClass("dashboard_widgethelper");
|
||||
if ($( ".dashboard_widget" ).hasClass("ui-resizable")) {
|
||||
$( ".dashboard_widget" ).resizable("destroy");
|
||||
};
|
||||
$( "#dashboard_tab" + iTabIndex + " .dashboard_widget" ).resizable("destroy");
|
||||
$( ".dashboard_column" ).removeClass("dashboard_columnhelper");
|
||||
}
|
||||
|
||||
function dashboard_unsetlock(){
|
||||
if(is_dashboard_flexible()) {
|
||||
$( ".dashboard_widget" ).draggable( "option", "disabled", false );
|
||||
}
|
||||
else {
|
||||
$( ".dashboard_column" ).sortable( "option", "disabled", false );
|
||||
}
|
||||
function dashboard_unsetlock(iTabIndex){
|
||||
if (DashboardConfigHash['lockstate'] == "unlock") { $( ".dashboard_widget" ).addClass("dashboard_widgethelper"); } else { $( ".dashboard_widget" ).removeClass("dashboard_widgethelper"); }//Show Widget-Helper Frame
|
||||
if (DashboardConfigHash['lockstate'] == "unlock") { $( ".dashboard_column" ).addClass("dashboard_columnhelper"); } else { $( ".dashboard_column" ).removeClass("dashboard_columnhelper"); }//Show Widget-Helper Frame
|
||||
dashboard_modifyWidget();
|
||||
@ -542,15 +533,15 @@ function dashboard_init_tab(tabIndex) {
|
||||
stop: function() { saveOrder(); }
|
||||
});
|
||||
}
|
||||
makeResizable('.dashboard_widget');
|
||||
makeResizable('#dashboard_tab' + tabIndex + ' .dashboard_widget');
|
||||
|
||||
// call the initialization of reading groups
|
||||
FW_readingsGroupReadyFn($('#dashboard_tab' + tabIndex));
|
||||
|
||||
if ((DashboardConfigHash['lockstate'] == "lock") || (dashboard_buttonbar == "hidden")) {
|
||||
dashboard_setlock();
|
||||
dashboard_setlock(tabIndex);
|
||||
} else {
|
||||
dashboard_unsetlock();
|
||||
dashboard_unsetlock(tabIndex);
|
||||
}
|
||||
restoreGroupVisibility(tabIndex);
|
||||
}
|
||||
@ -677,7 +668,7 @@ function dashboard_buildDashboard(){
|
||||
|
||||
dashboard_modifyWidget();
|
||||
if (dashboard_buttonbar != "hidden") dashboard_buildButtons();
|
||||
if ((DashboardConfigHash['lockstate'] == "lock") || (dashboard_buttonbar == "hidden")) {dashboard_setlock();} else {dashboard_unsetlock();}
|
||||
if ((DashboardConfigHash['lockstate'] == "lock") || (dashboard_buttonbar == "hidden")) {dashboard_setlock(iActiveTab);} else {dashboard_unsetlock(iActiveTab);}
|
||||
if (DashboardConfigHash['dashboard_customcss']) {$('<style type="text/css">'+DashboardConfigHash['dashboard_customcss']+'</style>').appendTo($('head')); }
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user