Commit d9c86a49 authored by Jacob Schatz's avatar Jacob Schatz

Add styles to look good on windows in general.

parent 78db68ab
...@@ -72,11 +72,22 @@ import RepoBundle from './repo/repo_bundle'; ...@@ -72,11 +72,22 @@ import RepoBundle from './repo/repo_bundle';
} }
Dispatcher.prototype.initPageScripts = function() { Dispatcher.prototype.initPageScripts = function() {
var page, path, shortcut_handler, fileBlobPermalinkUrlElement, fileBlobPermalinkUrl; var page, path, shortcut_handler, fileBlobPermalinkUrlElement, fileBlobPermalinkUrl, os;
page = $('body').attr('data-page'); page = $('body').attr('data-page');
if (!page) { if (!page) {
return false; return false;
} }
function getScrollBarWidth () {
var $outer = $('<div>').css({visibility: 'hidden', width: 100, overflow: 'scroll'}).appendTo('body'),
widthWithScroll = $('<div>').css({width: '100%'}).appendTo($outer).outerWidth();
$outer.remove();
return 100 - widthWithScroll;
};
$('body').attr('data-scroll-width', getScrollBarWidth());
path = page.split(':'); path = page.split(':');
shortcut_handler = null; shortcut_handler = null;
......
...@@ -14,6 +14,8 @@ let RepoStore = { ...@@ -14,6 +14,8 @@ let RepoStore = {
files: [], files: [],
binary: false, binary: false,
binaryMimeType: '', binaryMimeType: '',
//scroll bar space for windows
scrollWidth: 0,
binaryTypes: { binaryTypes: {
png: false png: false
} }
......
...@@ -5,6 +5,7 @@ import RepoMiniMixin from './repo_mini_mixin' ...@@ -5,6 +5,7 @@ import RepoMiniMixin from './repo_mini_mixin'
export default class RepoTabs { export default class RepoTabs {
constructor() { constructor() {
this.styleTabsForWindows();
this.initVue(); this.initVue();
} }
...@@ -18,4 +19,10 @@ export default class RepoTabs { ...@@ -18,4 +19,10 @@ export default class RepoTabs {
data: () => Store, data: () => Store,
}); });
} }
styleTabsForWindows() {
const scrollWidth = Number(document.body.dataset.scrollWidth);
Store.scrollWidth = scrollWidth;
console.log(Store.scrollWidth)
}
} }
\ No newline at end of file
...@@ -38,7 +38,8 @@ header { ...@@ -38,7 +38,8 @@ header {
display: inline-block; display: inline-block;
white-space: nowrap; white-space: nowrap;
width: 100%; width: 100%;
overflow: scroll; overflow-y: none;
overflow-x: scroll;
li { li {
list-style-type: none; list-style-type: none;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
%tr{ is: "repo-previous-directory", ":prevurl" => "prevURL", "@linkclicked" => "linkClicked" } %tr{ is: "repo-previous-directory", ":prevurl" => "prevURL", "@linkclicked" => "linkClicked" }
%tr{ is: "repo-file", "v-for" => "file in files", ":key" => "file.id", ":file" => "file",":is-mini" => "isMini", "@linkclicked" => "linkClicked(file)", ":is-tree" => "isTree" } %tr{ is: "repo-file", "v-for" => "file in files", ":key" => "file.id", ":file" => "file",":is-mini" => "isMini", "@linkclicked" => "linkClicked(file)", ":is-tree" => "isTree" }
.panel-right> .panel-right>
%ul#tabs{"v-if" => "isMini"} %ul#tabs{"v-if" => "isMini", ":style" => "{height: 41 + scrollWidth + 'px'}"}
%li{ is: "repo-tab", "v-for" => "tab in openedFiles", ":key" => "tab.id", ":tab" => "tab", ":class" => "{'active' : tab.active}" } %li{ is: "repo-tab", "v-for" => "tab in openedFiles", ":key" => "tab.id", ":tab" => "tab", ":class" => "{'active' : tab.active}" }
#ide{ data: { url: repo_url } } #ide{ data: { url: repo_url } }
#binary-viewer{ "v-if" => "binary" } #binary-viewer{ "v-if" => "binary" }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment