kopia lustrzana https://github.com/FacilMap/facilmap
Added line colour setting (for now without colour picker)
rodzic
5f16224973
commit
57f4460d88
|
@ -352,7 +352,14 @@
|
|||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.oppositeColour = function(colour) {
|
||||
var d1 = parseInt(colour.substr(0, 2), 16);
|
||||
var d2 = parseInt(colour.substr(2, 2), 16);
|
||||
var d3 = parseInt(colour.substr(4, 2), 16);
|
||||
return ((d1+d2+d3)/3 <= 64) ? "ffffff" : "000000";
|
||||
};
|
||||
});
|
||||
|
||||
function bindSocketToScope($scope, socket) {
|
||||
|
|
|
@ -198,4 +198,8 @@ textarea {
|
|||
|
||||
.pos,.distance {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
#edit-line-colour {
|
||||
width: auto;
|
||||
}
|
|
@ -120,6 +120,9 @@
|
|||
<option value="pedestrian">Pedestrian</option>
|
||||
</select></dd>
|
||||
|
||||
<dt><label for="edit-line-colour">Colour</label></dt>
|
||||
<dd><input id="edit-line-colour" ng-model="currentLine.colour" ng-style="{ 'background-color': '#'+currentLine.colour, color: '#'+oppositeColour(currentLine.colour) }"></dd>
|
||||
|
||||
<dt><label for="edit-line-description">Description</label></dt>
|
||||
<dd><textarea id="edit-line-description" ng-model="currentLine.description"></textarea></dd>
|
||||
</dl>
|
||||
|
|
Ładowanie…
Reference in New Issue