Skip to content
Permalink
Browse files

Make info container smaller and fix documentation for info.component

  • Loading branch information...
raitisbe committed Jul 20, 2019
1 parent 95a8fde commit da20b2e380cf7a306b80ee951cd94cd5963517f7
Showing with 30 additions and 34 deletions.
  1. +23 −23 components/info/info.component.js
  2. +2 −2 components/info/info.module.js
  3. +2 −1 components/map/map.service.js
  4. +3 −8 css/app.css
@@ -1,23 +1,19 @@
export default {
template: ['config', function (config) {
return {
template: require('components/info/partials/info.html')
};
}],
template: require('components/info/partials/info.html'),
controller: ['$rootScope', '$scope', '$timeout', 'Core',
function ($rootScope, $scope, $timeout, Core) {
$scope.Core = Core;
/**
* @ngdoc property
* @name hs.info.controller#composition_loaded
* @name hs.info#composition_loaded
* @public
* @type {Boolean} true
* @description Store if composition is loaded
*/
$scope.composition_loaded = true;
/**
* @ngdoc property
* @name hs.info.controller#layer_loading
* @name hs.info#layer_loading
* @public
* @type {Array} null
* @description List of layers which are currently loading.
@@ -29,23 +25,23 @@ export default {
if (angular.isDefined(data.data)) {
/**
* @ngdoc property
* @name hs.info.controller#composition_abstract
* @name hs.info#composition_abstract
* @public
* @type {String} null
* @description Abstract of current composition (filled when first composition is loaded)
*/
$scope.composition_abstract = data.data.abstract;
/**
* @ngdoc property
* @name hs.info.controller#composition_title
* @name hs.info#composition_title
* @public
* @type {String} null
* @description Title of current composition (filled when first composition is loaded)
*/
$scope.composition_title = data.data.title;
/**
* @ngdoc property
* @name hs.info.controller#composition_id
* @name hs.info#composition_id
* @public
* @type {Number} null
* @description Id of current composition (filled when first composition is loaded)
@@ -78,7 +74,7 @@ export default {
$scope.composition_loaded = true;
/**
* @ngdoc property
* @name hs.info.controller#composition_edited
* @name hs.info#composition_edited
* @public
* @type {Boolean} null
* @description Status of composition edit (true for edited composition)
@@ -87,22 +83,26 @@ export default {
});

$scope.$on('layermanager.layer_loading', function (event, layer) {
if (!(layer.get('title') in $scope.layer_loading)) {
$scope.layer_loading.push(layer.get('title'));
}
$scope.composition_loaded = false;
$timeout(function () {
if (!(layer.get('title') in $scope.layer_loading)) {
$scope.layer_loading.push(layer.get('title'));
}
$scope.composition_loaded = false;
})
})

$scope.$on('layermanager.layer_loaded', function (event, layer) {
for (var i = 0; i < $scope.layer_loading.length; i++) {
if ($scope.layer_loading[i] == layer.get('title')) {
$scope.layer_loading.splice(i, 1);
$timeout(function () {
for (var i = 0; i < $scope.layer_loading.length; i++) {
if ($scope.layer_loading[i] == layer.get('title')) {
$scope.layer_loading.splice(i, 1);
}
}
}

if ($scope.layer_loading.length == 0) {
$scope.composition_loaded = true;
}
if ($scope.layer_loading.length == 0) {
$scope.composition_loaded = true;
}
})
})

$scope.$on('compositions.composition_deleted', function (event, id) {
@@ -124,7 +124,7 @@ export default {

/**
* @ngdoc method
* @name hs.info.controller#compositionLoaded
* @name hs.info#compositionLoaded
* @public
* @description Test if composition is loaded, to change info template.
*/
@@ -12,8 +12,8 @@ import infoComponent from './info.component';
angular.module('hs.info', ['hs.map', 'hs.core', 'updateMeta'])
/**
* @module info
* @name hs.info.controller
* @ngdoc controller
* @name hs.info
* @ngdoc component
* @description Automatically updates composition abstract and status when composition is changed through appropriete composition / layermanager events. Shows mainly current composition status. Also display loading sign when composition is loading.
*/
.component('hs.info', infoComponent);
@@ -1,14 +1,15 @@
import '../permalink/permalink.module';
import {DoubleClickZoom, KeyboardPan, KeyboardZoom, MouseWheelZoom, PinchRotate, PinchZoom, DragPan, DragRotate, DragZoom} from 'ol/interaction';
import Kinetic from 'ol/Kinetic';
import Vector from 'ol/source/Vector';
import Map from 'ol/Map';
import View from 'ol/View';
import {MousePosition, defaults as controlDefaults} from 'ol/control';
import {createStringXY} from 'ol/coordinate';
import { TileWMS, WMTS } from 'ol/source';
import {ImageWMS, ImageArcGISRest} from 'ol/source';
import Feature from 'ol/Feature';
import {Group} from 'ol/layer';
import {Vector} from 'ol/source';

/**
* This is a workaround.
@@ -783,12 +783,12 @@ div#content-wrapper:not(.open) .minisidebar-wrapper {
}

div#hs-info-area {
background-color: rgba(255,255,255,0.4);
background-color: rgba(47, 88, 141, 0.4);
border-radius: 4px;
bottom: 8px;
color: white;
left: 0.5em;
padding: 2px;
padding: 1px;
pointer-events: initial;
position: absolute;
vertical-align: bottom;
@@ -815,7 +815,7 @@ div#hs-info-composition {
div#hs-info-composition-container {
font-size: 12px;
line-height: 12px;
padding: 12px;
padding: 4px;
}

div.hs-info-composition-title {
@@ -848,11 +848,6 @@ div#hs-info-composition-image > span {
width: 100px;
}

div#hs-info-area > div {
background-color: rgba(0,60,136,0.5);
margin: 1px;
}

div#hs-info-layers, div#hs-info-composition-edited {
font-size: 12px;
padding: 0 12px 12px 12px;

0 comments on commit da20b2e

Please sign in to comment.
You can’t perform that action at this time.