kopia lustrzana https://github.com/FacilMap/facilmap
Add dropdown to change type of existing marker/line
rodzic
86eae5420e
commit
638125c267
|
@ -365,6 +365,12 @@ textarea {
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
.type-select {
|
||||
position: absolute;
|
||||
bottom: .5em;
|
||||
right: 1em;
|
||||
}
|
||||
|
||||
|
||||
/********* z-index **************/
|
||||
|
||||
|
|
|
@ -132,4 +132,19 @@
|
|||
return fpUtils;
|
||||
} ]);
|
||||
|
||||
fp.app.filter('fpObjectFilter', function($filter){
|
||||
return function(input, query) {
|
||||
if(!query) return input;
|
||||
|
||||
var output = { };
|
||||
|
||||
for(var i in input) {
|
||||
if($filter("filter")([ input[i] ], query).length == 1)
|
||||
output[i] = input[i];
|
||||
}
|
||||
|
||||
return output;
|
||||
};
|
||||
});
|
||||
|
||||
})(FacilPad, jQuery, angular);
|
|
@ -25,4 +25,7 @@
|
|||
<div>
|
||||
<button ng-click="save()">Save</button>
|
||||
</div>
|
||||
<div class="type-select">
|
||||
<select ng-options="type.id as type.name for type in types | fpObjectFilter:{type:'line'}" ng-model="line.typeId"></select>
|
||||
</div>
|
||||
</form>
|
|
@ -13,4 +13,7 @@
|
|||
<div>
|
||||
<button ng-click="save()">Save</button>
|
||||
</div>
|
||||
<div class="type-select">
|
||||
<select ng-options="type.id as type.name for type in types | fpObjectFilter:{type:'marker'}" ng-model="marker.typeId"></select>
|
||||
</div>
|
||||
</form>
|
|
@ -107,7 +107,7 @@ database.connect(function(err) {
|
|||
},
|
||||
|
||||
editMarker : function(data, callback) {
|
||||
if(!utils.stripObject(data, { id: "number", lat: "number", lon: "number", name: "string", colour: "string", data: Object }))
|
||||
if(!utils.stripObject(data, { id: "number", lat: "number", lon: "number", name: "string", colour: "string", typeId: "number", data: Object }))
|
||||
return callback("Invalid parameters.");
|
||||
|
||||
if(!socket.writable)
|
||||
|
@ -144,7 +144,7 @@ database.connect(function(err) {
|
|||
},
|
||||
|
||||
editLine : function(data, callback) {
|
||||
if(!utils.stripObject(data, { id: "number", points: [ { lat: "number", lon: "number" } ], mode: "string", colour: "string", width: "number", name: "string", data: Object }))
|
||||
if(!utils.stripObject(data, { id: "number", points: [ { lat: "number", lon: "number" } ], mode: "string", colour: "string", width: "number", name: "string", typeId: "number", data: Object }))
|
||||
return callback("Invalid parameters.");
|
||||
|
||||
if(!socket.writable)
|
||||
|
|
Ładowanie…
Reference in New Issue