Autosize container directive. Infinite scrolls resized

This commit is contained in:
jesmg 2016-09-21 09:47:06 +00:00
parent 923a82fbe7
commit 0a2617b69f
10 changed files with 39 additions and 12 deletions

View File

@ -21,9 +21,16 @@ require('plugins/wazuh/objects/tabProvider.js');
require('plugins/wazuh/objects/testConnection.js');
require('plugins/wazuh/objects/errlog.js');
// Require directives
require('plugins/wazuh/objects/autoSizeContainer.js');
// Set up routes and views
require('plugins/wazuh/objects/routes.js');
// Require Kibana integrations
require('plugins/wazuh/controllers/visLoader.js');
require('plugins/wazuh/controllers/disLoader.js');
require('plugins/wazuh/controllers/dashLoader.js');
// Require controllers
require('plugins/wazuh/controllers/general.js');
@ -35,9 +42,6 @@ require('plugins/wazuh/controllers/fim.js');
require('plugins/wazuh/controllers/policy-monitoring.js');
require('plugins/wazuh/controllers/ruleset.js');
require('plugins/wazuh/controllers/osseclog.js');
require('plugins/wazuh/controllers/visLoader.js');
require('plugins/wazuh/controllers/disLoader.js');
require('plugins/wazuh/controllers/dashLoader.js');
//Bootstrap and font awesome
require('plugins/wazuh/../node_modules/bootstrap/dist/css/bootstrap.min.css');
@ -51,4 +55,4 @@ require('plugins/wazuh/../node_modules/angular-animate/angular-animate.js');
require('plugins/wazuh/../node_modules/angular-material/angular-material.js');
//Cookies
require('plugins/wazuh/../node_modules/angular-cookies/angular-cookies.min.js');
require('plugins/wazuh/../node_modules/angular-cookies/angular-cookies.min.js');

View File

@ -0,0 +1,23 @@
import $ from 'jquery';
require('ui/modules').get('app/wazuh', [])
.directive('autoSizeContainer', function () {
return {
restrict: 'A',
link: function ($scope, $element) {
var $window = $(window);
var winHeight = $window.height();
var winBottom = winHeight + $window.scrollTop();
var elTop = $element.offset().top;
var remaining = winBottom - elTop - 10;
console.log(winHeight);
console.log(winBottom);
console.log(elTop);
console.log(remaining);
$scope.autoSizeStyle = {'height': remaining+'px'};
}
}
});

View File

@ -1,7 +1,7 @@
<md-content ng-if="submenuNavItem == 'fim'" ng-if="_agent" class="md-padding">
<div flex ng-controller="fimController" layout="column">
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
<md-virtual-repeat-container style="min-height: 700px;" ng-if="!load">
<md-virtual-repeat-container auto-size-container ng-style="autoSizeStyle" ng-if="!load">
<md-content layout="row">
<md-card flex="40">
<md-card-title>

View File

@ -1,7 +1,7 @@
<md-content ng-if="submenuNavItem == 'policy_monitoring'" ng-if="_agent" class="md-padding">
<div flex ng-controller="pmController" layout="column">
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
<md-virtual-repeat-container class="vertical-repeater" style="min-height: 800px;" ng-if="!load">
<md-virtual-repeat-container class="vertical-repeater" auto-size-container ng-style="autoSizeStyle" ng-if="!load">
<md-content layout="row">
<md-card flex="40">
<md-card-title>

View File

@ -1,7 +1,7 @@
<md-content ng-if="!_agent || submenuNavItem == 'preview'" class="md-padding">
<div flex ng-controller="agentsPreviewController" layout="column">
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
<md-virtual-repeat-container style="min-height: 700px;" ng-if="!load">
<md-virtual-repeat-container auto-size-container ng-style="autoSizeStyle" ng-if="!load">
<div flex layout="column" layout-align="space-between stretch">
<div layout="row" layout-align="space-between stretch">

View File

@ -1,6 +1,6 @@
<md-content ng-if="!load && submenuNavItem =='logs'" ng-controller="osseclogController" layout="row" flex layout-padding>
<md-progress-linear class="md-accent" md-mode="indeterminate" ng-show="load"></md-progress-linear>
<md-virtual-repeat-container ng-if="!load" flex layout="column" layout-padding style="min-height: 500px;">
<md-virtual-repeat-container auto-size-container ng-if="!load" flex layout="column" layout-padding ng-style="autoSizeStyle">
<div flex layout="row" layout-align="start start">
<md-input-container class="md-whiteframe-z1" style="margin-right: 15px; " flex="20">
<label for="categoryBox">Choose daemon</label>

View File

@ -1,5 +1,5 @@
<md-content layout="row" flex layout-padding ng-if="!load && submenuNavItem2 == 'decoders'" ng-controller="decodersController">
<md-virtual-repeat-container ng-if="!load" flex layout="column" layout-padding style="min-height: 2000px;">
<md-virtual-repeat-container ng-if="!load" flex layout="column" layout-padding auto-size-container ng-style="autoSizeStyle">
<div flex id="content" layout="row" layout-align="space-between center">

View File

@ -4,7 +4,7 @@
<md-virtual-repeat-container layout-align="start start" ng-if="!load" flex layout="column" layout-padding style="min-height: 2000px;">
<md-virtual-repeat-container layout-align="start start" ng-if="!load" flex layout="column" layout-padding auto-size-container ng-style="autoSizeStyle">
<div flex id="content" layout="row" layout-align="center stretch">

View File

@ -1,5 +1,5 @@
<md-content layout="row" ng-if="!load && submenuNavItem2 == 'update'" layout-align="space-around start" layout-sm="column"
layout-xs="column" ng-controller="updateRulesetController" style="min-height: 500px;">
layout-xs="column" ng-controller="updateRulesetController" auto-size-container ng-style="autoSizeStyle">
<md-content layout="column" layout-align="space-around center">
<h2>Update</h2>

View File

@ -1,4 +1,4 @@
<div ng-init="submenuNavItem2 = 'rules'" flex layout="column" ng-if="submenuNavItem == 'ruleset'">
<div ng-init="submenuNavItem2 = 'rules'" flex layout="column" ng-if="submenuNavItem == 'ruleset'" auto-size-container ng-style="autoSizeStyle">
<div layout="row" layout-align="center center" style=" height: 50px; " ng-init="submenuNavItem2 = (state.getRulesetState() ? state.getRulesetState() : 'rules')">
<md-button ng-class="(submenuNavItem2 == 'rules') ? 'button-active' : 'button-disabled'" ng-class="button-disabled" ng-click="submenuNavItem2 = 'rules'"