Skip to content

Commit

Permalink
Merge branch 'always_on_top'
Browse files Browse the repository at this point in the history
  • Loading branch information
yoichiro committed Aug 17, 2014
2 parents ad1551f + e301e82 commit e24530e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "ChromeMyAdmin",
"short_name": "MyAdmin",
"description": "This application provides you 'MySQL GUI Admin console' windows.",
"version": "2.1.0",
"version": "2.2.0",
"author": "Yoichiro Tanaka",
"app": {
"background": {
Expand All @@ -13,7 +13,8 @@
}
},
"permissions": [
"storage"
"storage",
"alwaysOnTopWindows"
],
"offline_enabled": true,
"icons": {
Expand Down
11 changes: 11 additions & 0 deletions app/scripts/window/controllers/window_title_panel_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ chromeMyAdmin.controller("windowTitlePanelController", ["$scope", "mySQLClientSe
$scope.initialize = function() {
assignEventHandlers();
resetTitleText();
$scope.alwaysOnTop = false;
};

$scope.openNewWindow = function() {
Expand All @@ -104,4 +105,14 @@ chromeMyAdmin.controller("windowTitlePanelController", ["$scope", "mySQLClientSe
});
};

$scope.getAlwaysOnTopClass = function() {
return $scope.alwaysOnTop ? "fa-circle" : "fa-circle-o";
};

$scope.changeAlwaysOnTop = function() {
$scope.alwaysOnTop = !$scope.alwaysOnTop;
var appWindow = chrome.app.window.current();
appWindow.setAlwaysOnTop($scope.alwaysOnTop);
};

}]);
8 changes: 7 additions & 1 deletion app/styles/window.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
html, body {
mergin: 0;
margin: 0;
padding: 0;
}

Expand All @@ -11,6 +11,9 @@ body {
width: 100%;
height: 20px;
-webkit-app-region: drag;
border-top: 1px solid #eee;
border-left: 1px solid #eee;
border-right: 1px solid #eee;
}

.windowTitlePanel div {
Expand Down Expand Up @@ -57,6 +60,8 @@ body {
height: 25px;
background-color: white;
border-top: 1px solid #eee;
border-left: 1px solid #eee;
border-bottom: 1px solid #eee;
}

.footerButtonLeft {
Expand Down Expand Up @@ -150,6 +155,7 @@ body {
height: 25px;
background-color: white;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
padding-left: 5px;
}

Expand Down
1 change: 1 addition & 0 deletions app/templates/window_title_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<div class="titleText pull-left">{{titleText}}</div>
<div class="fa fa-expand pull-right" title="Fullscreen" ng-click="fullscreen()"></div>
<div class="fa fa-external-link pull-right" title="Open new window" ng-click="openNewWindow()"></div>
<div class="fa pull-right" ng-class="getAlwaysOnTopClass()" title="Always on top" ng-click="changeAlwaysOnTop()"></div>
</div>

0 comments on commit e24530e

Please sign in to comment.