Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Feb 8, 2017
1 parent b04212c commit f0c9f1d
Show file tree
Hide file tree
Showing 11 changed files with 407 additions and 380 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,12 +303,12 @@ class DirectiveEditForm(
processKey(event , '${htmlId_save}');
} );
checkMigrationButton("${currentVersion}","${versionSelectId}");

$$('#${versionSelect.uniqueFieldId.getOrElse("id_not_found")}').change(
function () {
checkMigrationButton("${currentVersion}","${versionSelectId}")
}
);
adjustHeight("#edit-box","#directiveToolbar")
""")

)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ class RuleDisplayer (
<button class="btn btn-sm btn-box-tool" data-widget="collapse"><i class="fa fa-chevron-down"></i></button>
</div>
</div>
<div class="box-body">
<div class="box-body" id="boxTreeRules">
<div class="row">
<div class="col-xs-12" id="categoryTreeParent">
{viewCategories(ruleCategoryTree)}
Expand Down Expand Up @@ -328,7 +328,8 @@ class RuleDisplayer (
</div> ++ Script(JsRaw(s"""
var include = true;
var filter = "";
var column = ${columnToFilter};"""
var column = ${columnToFilter};
"""
) )
case eb:EmptyBox =>
val fail = eb ?~! "Could not get root category"
Expand Down Expand Up @@ -414,6 +415,8 @@ class RuleDisplayer (
</div>
}
SetHtml(htmlId_popup, popupHtml) &
JsRaw( s""" createPopup("${htmlId_popup}") """)
JsRaw( s"""
createPopup("${htmlId_popup}");
""")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,8 @@ class DirectiveManagement extends DispatchSnippet with Loggable {
def initTechniqueDetails(workflowEnabled: Boolean) : MemoizeTransform = SHtml.memoize {
"#techniqueDetails *" #> ( currentTechnique match {
case None =>
".page-title *" #> "Usage" &
"h3 *" #> "Usage" &
"#details *" #> {
<div class="tw-bs">
<div class="col-lg-12">
<div class="col-lg-12 callout-fade callout-warning">
<div class="marker">
Expand All @@ -265,7 +264,6 @@ class DirectiveManagement extends DispatchSnippet with Loggable {
</p>
</div>
</div>
</div>
}

case Some((fullActiveTechnique,version)) =>
Expand Down
20 changes: 7 additions & 13 deletions rudder-web/src/main/webapp/javascript/rudder/angular/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,23 +367,17 @@ app.controller('filterTagRuleCtrl', function ($scope, $http, $location, $timeout
);
}
$scope.initFilterTable();
$(document).ready(function(){
adjustHeight('#boxTreeRules','.rule-footer');
$(window).on('resize',function(){
adjustHeight('#boxTreeRules','.rule-footer');
});
});
});

app.config(function($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
})

// Adjust tree height
function adjustHeight(treeId){
var tree = $(treeId);
var treeOffset = tree.offset()
if(treeOffset){
var offsetTop = treeOffset.top + 10;
var maxHeight = 'calc(100vh - '+ offsetTop + 'px)';
tree.css('max-height',maxHeight);
}
}

});
2 changes: 2 additions & 0 deletions rudder-web/src/main/webapp/javascript/rudder/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@

$(document).ready(function(){
var treeId = '#activeTechniquesTree';
var formId = '#edit-box';
$(window).on('resize',function(){
adjustHeight(treeId);
adjustHeight(formId,"#directiveToolbar");
});
$(treeId).on("searchtag.jstree",function(e, data){
data.res.length>0 ? $('#activeTechniquesTree_alert').hide() : $('#activeTechniquesTree_alert').show();
Expand Down
23 changes: 18 additions & 5 deletions rudder-web/src/main/webapp/javascript/rudder/rudder.js
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,23 @@ function hideFileManager(){
}

//Adjust tree height
function adjustHeight(treeId, height){
function adjustHeight(treeId, toolbar){
var tree = $(treeId);
var offsetTop = tree.offset().top + 12;
var maxHeight = 'calc(100vh - '+ offsetTop + 'px)';
var cssProp = height ? 'height' : 'max-height'
tree.css(cssProp,maxHeight);
var maxHeight;
if(window.innerWidth>=992){
var treeOffset = tree.offset();
if(treeOffset){
var toolbarHeight;
if(toolbar && $(toolbar).offset()){
toolbarHeight = parseFloat($(toolbar).css('height'));
}else{
toolbarHeight = 0;
}
var offsetTop = treeOffset.top + 15 + toolbarHeight;
maxHeight = 'calc(100vh - '+ offsetTop + 'px)';
}
}else{
maxHeight = "none";
}
tree.css('max-height',maxHeight);
}
Loading

0 comments on commit f0c9f1d

Please sign in to comment.