Correct bug
This commit is contained in:
parent
ae4e028231
commit
5b5f526aa0
4 changed files with 19 additions and 11 deletions
|
@ -5,8 +5,9 @@
|
||||||
*/
|
*/
|
||||||
mainApp.controller('editImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', 'upload', function ($scope, Image, Loading, Identity, upload)
|
mainApp.controller('editImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', 'upload', function ($scope, Image, Loading, Identity, upload)
|
||||||
{
|
{
|
||||||
$scope.$on('editImageEvent', function (eventName, image) {
|
$scope.$on('editImageEvent', function (eventName, image,axioms) {
|
||||||
$scope.image = image;
|
$scope.image = image;
|
||||||
|
$scope.axioms=axioms;
|
||||||
$('#editImageModal').modal('show');
|
$('#editImageModal').modal('show');
|
||||||
console.log(image)
|
console.log(image)
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,7 +23,7 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity','$root
|
||||||
}
|
}
|
||||||
|
|
||||||
$scope.edit=function(image){
|
$scope.edit=function(image){
|
||||||
$rootScope.$broadcast("editImageEvent", image);
|
$rootScope.$broadcast("editImageEvent", image, Image.getData().axioms);
|
||||||
|
|
||||||
}
|
}
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -4,7 +4,9 @@ mainApp.factory('Image', ['$http', 'Identity', function ($http, Identity) {
|
||||||
// Data object
|
// Data object
|
||||||
var data = {};
|
var data = {};
|
||||||
data.images = null; // Images
|
data.images = null; // Images
|
||||||
|
data.axioms={};
|
||||||
|
data.axioms.protected=[true,false];
|
||||||
|
data.axioms.visibility=["public", "private"];
|
||||||
/**
|
/**
|
||||||
* Parse uploadImage anwser
|
* Parse uploadImage anwser
|
||||||
* @param {type} response
|
* @param {type} response
|
||||||
|
|
|
@ -18,15 +18,20 @@
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<p class="form-control-static">{{ image.name}}</p>
|
<p class="form-control-static">{{ image.name}}</p>
|
||||||
</div>
|
</div>
|
||||||
<label class="control-label col-sm-2">Protected</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<p class="form-control-static">{{ image.protected}}</p>
|
|
||||||
</div>
|
|
||||||
<label class="control-label col-sm-2">Visibility</label>
|
|
||||||
<div class="col-sm-10">
|
|
||||||
<p class="form-control-static">{{ image.visibility}}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<fieldset class="form-group">
|
||||||
|
<label class="control-label col-sm-2">Visibility</label>
|
||||||
|
<select class="col-sm-20" id="visibilitySelected">
|
||||||
|
<option ng-repeat="visibility in axioms.visibility" ng-selected="image.visibility == visibility">{{ visibility}}</option>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset class="form-group">
|
||||||
|
<label class="control-label col-sm-2">Protected</label>
|
||||||
|
<select class="col-sm-20" id="protectedSelected">
|
||||||
|
<option ng-repeat="protected in axioms.protected" ng-selected="image.protected == protected">{{ protected}}</option>
|
||||||
|
</select>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
|
|
Loading…
Add table
Reference in a new issue