Skip to content
Permalink
Browse files

Loading of css for material design layout with webpack

  • Loading branch information...
raitisbe committed Jun 8, 2019
1 parent 5dbd6e4 commit 47d86395c4ee776ffb0dd36dbb1c645c025c7ec7
@@ -28,6 +28,7 @@ exports.paths = [
__dirname + '/components/drag',
__dirname + '/components/draw',
__dirname + '/components/feature_crossfilter',
__dirname + '/components/feature_filter',
__dirname + '/components/floating_action_button',
__dirname + '/components/format',
__dirname + '/components/geolocation',
@@ -26,7 +26,7 @@ var module = angular.module('hs.feature_filter', ['hs.map', 'hs.core', 'hs.layer
*/
module.directive('hs.featureFilter.directive', ['config', function (config) {
return {
template: require(`components/feature_filter/partials/feature_filter.html`),
template: require(`components/feature_filter/partials/feature_filtermd.html`),
link: function (scope, element) {

}
@@ -41,7 +41,7 @@ module.directive('hs.featureFilter.directive', ['config', function (config) {
*/
module.directive('hs.featureList.directive', ['config', function (config) {
return {
template: require(`components/feature_filter/partials/feature_list.html`),
template: require(`components/feature_filter/partials/feature_listmd.html`),
link: function (scope, element) {

}
@@ -18,15 +18,15 @@ angular.module('hs.layout', ['hs.core', 'hs.map', 'hs.geolocation', 'hs.layerman
* @name hs.mdLayout.directive
* @description TODO
*/
.directive('hs.layout.directive', ['hs.map.service', 'Core', '$timeout', 'config', '$compile',
function (OlMap, Core, $timeout, config, $compile) {
.directive('hs.layout.directive', ['hs.map.service', 'Core', '$timeout', 'config', '$compile', '$injector',
function (OlMap, Core, $timeout, config, $compile, $injector) {
return {
template: require('components/layout/partials/layout.html'),
template: config.design == 'md' ? require('components/layout/partials/layoutmd.html') : require('components/layout/partials/layout.html'),
link: function (scope, element) {
try {
if (angular.module('hs.cesium')) {
if (element[0].querySelector('.page-content')) {
let cesiumDir = $compile('<div hs.cesium.directive ng-controller="hs.cesium.controller"></div>')(scope);
let cesiumDir = $compile('<div hs.cesium.directive ng-controller="hs.cesium.controller"></div>')(scope);
element[0].querySelector('.page-content').appendChild(cesiumDir[0]);
}
}
@@ -40,7 +40,7 @@ angular.module('hs.layout', ['hs.core', 'hs.map', 'hs.geolocation', 'hs.layerman
//Hack - flex map container was not initialized when map loaded
var container = document.getElementById('map-container');
if (container) {
if (container.height() === 0) {
if (container.clientHeight === 0) {
containerCheck();
}

@@ -51,17 +51,23 @@ angular.module('hs.layout', ['hs.core', 'hs.map', 'hs.geolocation', 'hs.layerman
}, 100);
}
}

if(angular.isUndefined(config.importCss) || config.importCss){
if(config.useIsolatedBootstrap){
require('bootstrap/dist/css/bootstrap.isolated.css')

if (angular.isUndefined(config.importCss) || config.importCss) {
if (config.design == 'md') {
require('angular-material/angular-material.css');
require('angular-material-bottom-sheet-collapsible/bottomSheetCollapsible.css');
} else {
require('bootstrap/dist/css/bootstrap.css')
if (config.useIsolatedBootstrap) {
require('bootstrap/dist/css/bootstrap.isolated.css')
} else {
require('bootstrap/dist/css/bootstrap.css')
}
}
if(!!window.cordova){

if (!!window.cordova) {
require('css/mobile.css')
}
require ('css/whhg-font/css/whhg.css')
require('css/whhg-font/css/whhg.css')
}
}
};
@@ -171,7 +177,7 @@ angular.module('hs.layout', ['hs.core', 'hs.map', 'hs.geolocation', 'hs.layerman
.controller('hs.layout.controller', ['$scope', '$injector', '$rootScope', '$window', 'Core', 'hs.map.service', 'hs.geolocation.service', 'hs.layermanager.service', 'gettextCatalog', 'config', '$templateCache', '$timeout', '$interval', 'hs.layout.service',
function ($scope, $injector, $rootScope, $window, Core, OlMap, Geolocation, LayerManager, gettextCatalog, config, $templateCache, $timeout, $interval, layoutService) {
if (config.design == 'md')
window.require(['bottomSheetCollapsible']);
require(['bottomSheetCollapsible']);
$scope.importCss = angular.isDefined(config.importCss) ? config.importCss : true;
$scope.useIsolatedBootstrap = angular.isDefined(config.useIsolatedBootstrap) ? config.useIsolatedBootstrap : false;
$scope.Core = Core;
@@ -1,13 +1,7 @@
<link rel="stylesheet" ng-href="{{Core.getNmPath()}}/angular-material/angular-material.css" type="text/css">
<link rel="stylesheet" ng-href="{{Core.getNmPath()}}/angular-material-bottom-sheet-collapsible/bottomSheetCollapsible.css" type="text/css">
<!-- Roboto Draft -->
<!-- <link href='https://fonts.googleapis.com/css?family=RobotoDraft:400,500,700,400italic' rel='stylesheet' type='text/css'> -->
<!--Import Google Icon Font-->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" type="text/css" ng-href="{{hsl_path}}css/mobile.css" ng-if="importCss && !!window.cordova">
<link rel="stylesheet" ng-if="importCss" ng-href="{{hsl_path}}css/app.css"/>
<link rel="stylesheet" ng-if="importCss" ng-href="{{hsl_path}}css/whhg-font/css/whhg.css"/>

<div hs.swipe-area.directive></div>
<div hs.md-toolbar.directive></div>
<section flex layout="row">

0 comments on commit 47d8639

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