Merge pull request #725 from lasanthaDLPDS/master

Improving Android Sense UI
revert-dabc3590
Rasika Perera 8 years ago committed by GitHub
commit fc83514648

@ -44,7 +44,12 @@
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-statistics fw-stack-1x"></i> <i class="fw fw-statistics fw-stack-1x"></i>
<span class="fw-stack fw-move-right fw-move-bottom">
<i class="fw fw-circle fw-stack-2x fw-stroke"></i>
<i class="fw fw-clock fw-stack-1x fw-inverse"></i>
</span> </span>
</span>
</a> </a>
</div> </div>
</div> </div>

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -78,6 +78,8 @@ var graphMap = {};
var palette = new Rickshaw.Color.Palette({scheme: "munin"}); var palette = new Rickshaw.Color.Palette({scheme: "munin"});
var elemTop;
$(window).load(function () { $(window).load(function () {
graphMap["battery"]=lineGraph("battery", batteryData); graphMap["battery"]=lineGraph("battery", batteryData);
@ -321,7 +323,7 @@ function maximizeGraph(graph, width,height){
height: height*2 height: height*2
}); });
graph.render(); graph.update();
} }
function minimizeGraph(graph){ function minimizeGraph(graph){
@ -329,7 +331,7 @@ function minimizeGraph(graph){
width: 366, width: 366,
height: 300 height: 300
}); });
graph.render(); graph.update();
} }
//maximize minimize functionality //maximize minimize functionality
@ -339,17 +341,30 @@ $(".fw-expand").click(function(e) {
var height = $(".chartWrapper").height(); var height = $(".chartWrapper").height();
if($(this).hasClass("default-view")){ if($(this).hasClass("default-view")){
elemTop = $('#'+innerGraph.element.id).parents('.graph')[0].offsetTop;
$(this).removeClass("default-view"); $(this).removeClass("default-view");
$(this).removeClass("fw-expand");
$(this).addClass("fw-contract");
maximizeGraph(innerGraph,width,height); maximizeGraph(innerGraph,width,height);
$(this).parent().parent().addClass("max"); $(this).parent().parent().addClass("max");
$(this).closest(".graph").siblings().addClass("max_hide"); $(this).closest(".graph").siblings().addClass("max_hide");
$(this).closest(".graph").parent().siblings().addClass("max_hide"); $(this).closest(".graph").parent().siblings().addClass("max_hide");
}else{ }else{
$(this).addClass("default-view"); $(this).addClass("default-view");
$(this).addClass("fw-expand");
$(this).removeClass("fw-contract");
minimizeGraph(innerGraph); minimizeGraph(innerGraph);
$(this).parent().parent().removeClass("max"); $(this).parent().parent().removeClass("max");
$(this).closest(".graph").siblings().removeClass("max_hide"); $(this).closest(".graph").siblings().removeClass("max_hide");
$(this).closest(".graph").parent().siblings().removeClass("max_hide"); $(this).closest(".graph").parent().siblings().removeClass("max_hide");
focusToArea()
} }
}); });
//graph focusing function
function focusToArea(){
var container = $("body");
container.animate({
scrollTop: elemTop
});
}

@ -5,6 +5,7 @@
"scopes" : [ "scopes" : [
"perm:android-sense:enroll" "perm:android-sense:enroll"
], ],
"analyticsView" : "DAS" "analyticsView" : "DAS",
"analyticsEnabled": false
} }
} }
Loading…
Cancel
Save