Make infoBox resizable

pull/108/head
Candid Dauth 2017-05-14 00:03:44 +02:00
rodzic 18a3452f9f
commit 0ab0b6fd92
4 zmienionych plików z 67 dodań i 28 usunięć

Wyświetl plik

@ -3,4 +3,6 @@
<div class="html"></div> <div class="html"></div>
<button type="button" class="btn btn-link close-button" ng-click="hide()">&times;</button> <button type="button" class="btn btn-link close-button" ng-click="hide()">&times;</button>
</div> </div>
<a href="javascript:" class="ui-resizable-handle ui-resizable-nw"><span class="glyphicon glyphicon-resize-horizontal"></span></a>
</div> </div>

Wyświetl plik

@ -15,6 +15,14 @@ fm.app.factory("fmInfoBox", function($rootScope, $compile, $timeout) {
$timeout(() => { $timeout(() => {
el.insertAfter(map.map.getContainer()).hide(); el.insertAfter(map.map.getContainer()).hide();
$compile(el)(scope); $compile(el)(scope);
el.resizable({
handles: {
nw: el.find(".ui-resizable-handle")
},
minHeight: 100,
minWidth: 250
});
}); });
let infoBox = { let infoBox = {

Wyświetl plik

@ -3,8 +3,6 @@
right: 10px; right: 10px;
bottom: 25px; bottom: 25px;
z-index: 800; z-index: 800;
width: 350px;
max-width: 100%;
font-size: 12px; font-size: 12px;
@ -19,8 +17,12 @@
box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075); box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 5px rgba(0,0,0,.075);
margin-bottom: 0; margin-bottom: 0;
width: 350px;
height: 200px;
.panel-body { .panel-body {
padding: 0; padding: 0;
height: 100%;
.close-button { .close-button {
position: absolute; position: absolute;
@ -33,8 +35,11 @@
font-weight: bold; font-weight: bold;
} }
.html {
height: 100%;
.content { .content {
height: 200px; height: calc(100% - 47px);
overflow: auto; overflow: auto;
/* Replace padding by margin to move horizontal scrollbar a bit to the left so that it can be covered by .buttons */ /* Replace padding by margin to move horizontal scrollbar a bit to the left so that it can be covered by .buttons */
@ -66,6 +71,7 @@
color: #888; color: #888;
} }
} }
}
.buttons { .buttons {
position: absolute; position: absolute;
@ -82,6 +88,28 @@
} }
} }
} }
.ui-resizable-handle {
position: absolute;
top: 0;
left: 0;
transform: translate(-20%,-20%) rotate(45deg);
cursor: nwse-resize;
font-size: 15px;
border: 1px solid #ddd;
border-radius: 1000px;
display: inline-block;
background: #fff;
line-height: 25px;
width: 25px;
height: 25px;
text-align: center;
vertical-align: middle;
box-shadow: 0 1px 2px rgba(0, 0, 0, .075);
color: #666;
opacity: 0.5;
transition: opacity .7s;
}
} }
.fm-map-legend.fm-infoBox-hidden { .fm-map-legend.fm-infoBox-hidden {

Wyświetl plik

@ -1,5 +1,6 @@
:local(.className) { :local(.className) {
margin-top: 44px !important; margin-top: 44px !important;
height: calc(100% - 89px) !important;
padding: 5px; padding: 5px;
.nav-tabs { .nav-tabs {