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 9, 2017
1 parent b04212c commit f2f751e
Show file tree
Hide file tree
Showing 14 changed files with 449 additions and 396 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 @@ -414,6 +414,6 @@ 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" &
"#info-title *" #> "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 Expand Up @@ -316,15 +314,15 @@ class DirectiveManagement extends DispatchSnippet with Loggable {
{ if(comp.os.isEmpty) {
NodeSeq.Empty
} else {
<p><b>Supported operating systems: </b>{comp.os.mkString(", ")}</p>
<li><b>Supported operating systems: </b>{comp.os.mkString(", ")}</li>
} } ++ {
if (comp.agents.isEmpty) {
NodeSeq.Empty
} else {
<p><b>Supported agents: </b>{comp.agents.mkString(", ")}</p>
<li><b>Supported agents: </b>{comp.agents.mkString(", ")}</li>
} }
} &
"#techniqueDescription" #> technique.description &
"#techniqueDescription *" #> technique.description &
"#techniqueLongDescription" #> technique.longDescription &
"#isSingle *" #> showIsSingle(technique) &
"#techniqueVersion *+" #> showVersions(fullActiveTechnique, validTechniqueVersions, workflowEnabled)
Expand Down
14 changes: 1 addition & 13 deletions rudder-web/src/main/webapp/javascript/rudder/angular/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,4 @@ app.config(function($locationProvider) {
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 f2f751e

Please sign in to comment.