- added map tab sorting (drag&drop), closed #571

- JS refactoring for core map sync, moved from "callback functions" to "Promises"
- improved JS click observer, moved to "parent" DOM elements with "bubbling up"
This commit is contained in:
Mark Friedrich
2017-12-30 22:01:33 +01:00
parent a5fafa2b02
commit 4f65f3b78c
10 changed files with 1277 additions and 966 deletions

View File

@@ -10,10 +10,10 @@ define([
'app/logging',
'app/page',
'app/map/worker',
'app/module_map',
'app/key',
'app/ui/form_element',
'app/module_map'
], ($, Init, Util, Render, Logging, Page, MapWorker) => {
'app/ui/form_element'
], ($, Init, Util, Render, Logging, Page, MapWorker, ModuleMap) => {
'use strict';
@@ -112,12 +112,12 @@ define([
switch(MsgWorkerMessage.task()){
case 'mapUpdate':
Util.updateCurrentMapData( MsgWorkerMessage.data() );
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule);
break;
case 'mapAccess':
case 'mapDeleted':
Util.deleteCurrentMapData( MsgWorkerMessage.data() );
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule);
break;
}
@@ -266,22 +266,24 @@ define([
Util.setCurrentMapData(data.mapData);
// load/update main map module
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule).then(() => {
// map update done, init new trigger
// get the current update delay (this can change if a user is inactive)
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
// get the current update delay (this can change if a user is inactive)
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
// init new trigger
initMapUpdatePing(false);
// init new trigger
initMapUpdatePing(false);
// initial start for the userUpdate trigger
// this should only be called at the first time!
if(updateTimeouts.userUpdate === 0){
// start user update trigger after map loaded
updateTimeouts.userUpdate = setTimeout(() => {
triggerUserUpdatePing();
}, 1000);
}
// initial start for the userUpdate trigger
// this should only be called at the first time!
if(updateTimeouts.userUpdate === 0){
// start user update trigger after map loaded
updateTimeouts.userUpdate = setTimeout(() => {
triggerUserUpdatePing();
}, 1000);
}
});
}
}).fail(handleAjaxErrorResponse);
@@ -289,7 +291,6 @@ define([
// skip this mapUpdate trigger and init next one
initMapUpdatePing(false);
}
};
// ping for user data update =======================================================

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,9 @@ define([
'app/util',
'app/render',
'bootbox',
'app/map/util'
], function($, Init, Util, Render, bootbox, MapUtil) {
'app/map/util',
'app/module_map'
], function($, Init, Util, Render, bootbox, MapUtil, ModuleMap) {
'use strict';
let config = {
@@ -382,7 +383,7 @@ define([
let tabLinkElement = Util.getMapModule().getMapTabElements(responseData.mapData.mapData.id);
if(tabLinkElement.length === 1){
tabLinkElement.updateTabData(responseData.mapData.mapData);
ModuleMap.updateTabData(tabLinkElement, responseData.mapData.mapData);
}
$(mapInfoDialog).modal('hide');

File diff suppressed because one or more lines are too long

View File

@@ -10,10 +10,10 @@ define([
'app/logging',
'app/page',
'app/map/worker',
'app/module_map',
'app/key',
'app/ui/form_element',
'app/module_map'
], ($, Init, Util, Render, Logging, Page, MapWorker) => {
'app/ui/form_element'
], ($, Init, Util, Render, Logging, Page, MapWorker, ModuleMap) => {
'use strict';
@@ -112,12 +112,12 @@ define([
switch(MsgWorkerMessage.task()){
case 'mapUpdate':
Util.updateCurrentMapData( MsgWorkerMessage.data() );
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule);
break;
case 'mapAccess':
case 'mapDeleted':
Util.deleteCurrentMapData( MsgWorkerMessage.data() );
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule);
break;
}
@@ -266,22 +266,24 @@ define([
Util.setCurrentMapData(data.mapData);
// load/update main map module
mapModule.updateMapModule();
ModuleMap.updateMapModule(mapModule).then(() => {
// map update done, init new trigger
// get the current update delay (this can change if a user is inactive)
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
// get the current update delay (this can change if a user is inactive)
let mapUpdateDelay = Util.getCurrentTriggerDelay( logKeyServerMapData, 0 );
// init new trigger
initMapUpdatePing(false);
// init new trigger
initMapUpdatePing(false);
// initial start for the userUpdate trigger
// this should only be called at the first time!
if(updateTimeouts.userUpdate === 0){
// start user update trigger after map loaded
updateTimeouts.userUpdate = setTimeout(() => {
triggerUserUpdatePing();
}, 1000);
}
// initial start for the userUpdate trigger
// this should only be called at the first time!
if(updateTimeouts.userUpdate === 0){
// start user update trigger after map loaded
updateTimeouts.userUpdate = setTimeout(() => {
triggerUserUpdatePing();
}, 1000);
}
});
}
}).fail(handleAjaxErrorResponse);
@@ -289,7 +291,6 @@ define([
// skip this mapUpdate trigger and init next one
initMapUpdatePing(false);
}
};
// ping for user data update =======================================================

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,9 @@ define([
'app/util',
'app/render',
'bootbox',
'app/map/util'
], function($, Init, Util, Render, bootbox, MapUtil) {
'app/map/util',
'app/module_map'
], function($, Init, Util, Render, bootbox, MapUtil, ModuleMap) {
'use strict';
let config = {
@@ -382,7 +383,7 @@ define([
let tabLinkElement = Util.getMapModule().getMapTabElements(responseData.mapData.mapData.id);
if(tabLinkElement.length === 1){
tabLinkElement.updateTabData(responseData.mapData.mapData);
ModuleMap.updateTabData(tabLinkElement, responseData.mapData.mapData);
}
$(mapInfoDialog).modal('hide');

View File

@@ -1008,12 +1008,13 @@ input[type="email"]{
}
.nav-tabs>li>a {
color: $gray-lighter;
color: $gray-light;
//color: $gray-lighter;
font-family: $font-family-bold;
&:hover{
color: $gray-darkest;
border-color: transparent transparent $gray-lighter transparent;
color: $gray-lighter;
border-color: transparent transparent $gray-light transparent;
margin-top: 1px;
border-top-width: 0;
}
@@ -1021,7 +1022,7 @@ input[type="email"]{
.nav-tabs > li.active > a {
background-color: $gray-lighter;
color: $gray-darker;
color: $gray-darkest;
border-top-width: 0px !important;
margin-top: 1px !important;
font-weight:bold;

View File

@@ -392,7 +392,7 @@ $navbar-inverse-toggle-border-color: #333;
//=== Shared nav styles
$nav-link-padding: 5px 6px 5px;
$nav-link-hover-bg: $gray-light;
$nav-link-hover-bg: $gray;
$nav-disabled-link-color: $gray-light;
$nav-disabled-link-hover-color: $gray-light;

View File

@@ -19,7 +19,7 @@ a, .pf-link{
will-change: color;
text-decoration: none;
cursor: pointer;
@include transition( color 0.08s ease-out );
@include transition( color 0.08s ease-out, background-color 0.08s ease-out );
&:hover{
color: $teal-lightest;
@@ -506,6 +506,26 @@ table{
// Tabs (colored)
#pf-map-tabs {
a[role="tab"]:hover{
.pf-map-tab-handler:before{
color: $orange
}
}
.pf-map-tab-handler{
&:before{
content: '\22EE\22EE\00A0';
display: inline-block;
cursor: -moz-grab !important;
cursor: -webkit-grab !important;
cursor: grab !important;
color: $gray-light;
width: 12px;
transition: color 0.15s ease-out, background-color 0.15s ease-out;
pointer-events: all;
}
}
.pf-map-type-tab-default{
border-top: 2px solid transparent;
}
@@ -527,11 +547,11 @@ table{
}
.pf-map-tab-icon{
margin-right: 5px;
margin-right: 3px;
}
.pf-map-tab-shared-icon{
margin-left: 5px;
margin-left: 3px;
}
}
}