persistent modals, almost perfect

parent 599f91b1
......@@ -173,7 +173,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
};
$scope.addOwnPicto = function () {
console.log($scope.picFile);
$scope.progress = 0;
var modalInstance = $modal.open({
animation: true,
......@@ -186,7 +186,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
progress: () => {return $scope.progress;}
}
});
modalInstance.result.then(function () {});
modalInstance.result.then(function () {$scope.picFile=null;});
};
/**
......@@ -212,7 +212,7 @@ dashboardControllers.controller('AddPictoCtrl', function (
picto.expressions = [];
$scope.open_exp(picto, () => {
$scope.pictos.push(picto);
load_own_pictos();
$scope.load_own_pictos();
cb();
});
});
......
......@@ -369,6 +369,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
// Returned data from the modal window
modalInstance.result.then(function (pictoId) {
if(!pictoId)
return;
// Send the picto to the server
$http.post(config.backend + '/stu/' + $scope.studentData.id + '/picto/' + pictoId, {
attributes: {
......
<div>
<div class="modal-header">
<div class="modal-header">
<button type="button" class="close" ng-click="close()">
<span aria-hidden="true">&times;</span><span class="sr-only" translate>close</span>
</button>
<h4 class="modal-title" id="myModalLabel" translate ng-show="!onlyOwn">add_picto</h4>
<h4 class="modal-title" id="myModalLabel" translate ng-show="onlyOwn">own_pictos</h4>
......@@ -18,10 +19,12 @@
<span class="glyphicon glyphicon-picture"></span> {{ 'own_pictos' | translate }}
</button>
</div>
</div>
</div><!-- /modal-header -->
<div class="modal-body">
<!-- Bread and categories -->
<div id="bread_and_categories" ng-show="source == 'symbolstx' && !onlyOwn" class="panel panel-default">
<div class="panel-heading">
<div class="pull-left" ng-repeat="b in breadcrumbs">
......@@ -44,9 +47,15 @@
<alert ng-show="alert.show" ng-model="alert" type="{{alert.type}}" close="closeAlert()">{{alert.msg | translate}}</alert>
</div>
<!-- Collections row -->
<div class="row">
<!-- Collections -->
<div id="collections" class="col-md-12 category-collection"
ng-class="{ 'category-collection-loading': loadingCatPictos }"
data-loading="{{ 'loading_pictos' | translate }}">
<!-- Filter form -->
<form ng-submit="search()" ng-show="!onlyOwn">
<div class="input-group" id="search_pictos_box">
<input type="text" class="form-control" placeholder="{{ 'filter' | translate }}"
......@@ -58,20 +67,21 @@
</span>
</div>
</form>
<!-- Add new image -->
<div ng-show="source == 'ownpictos'" class="input-group">
<button class="btn btn-success" ngf-select ng-model="picFile" accept="image/*" ngf-change="addOwnPicto()">
<span class="glyphicon glyphicon-folder-open"></span> {{ 'new_img' | translate }}
</button>
</div>
<!-- Galería de pictos -->
<div id="clearfix-infiniteScroll-parent" infinite-scroll="scroll()"
infinite-scroll-container="'#collections'">
<div
class="picto_peq pull-left"
ng-repeat="p in pictos" >
<!-- Picto galery -->
<div id="clearfix-infiniteScroll-parent" infinite-scroll="scroll()" infinite-scroll-container="'#collections'">
<div class="picto_peq pull-left" ng-repeat="p in pictos" >
<img ng-src="{{p.uri}}" popover="{{p.expressions[0].text}}" popover-trigger="mouseenter" />
<div class="picto_options">
<!-- Options to remove picto (Only for own pictos) -->
<div class="picto_options">
<a ng-click="remove_own_picto(p.id)" class="picto_remove" title="{{ 'delete' | translate}}" ng-show="source == 'ownpictos'">
<span class="color_red glyphicon glyphicon-remove-circle" aria-hidden="true"></span>
</a>
......@@ -81,19 +91,18 @@
title="{{ 'add_picto' | translate}}">
<span class="color_green glyphicon glyphicon-plus-sign" aria-hidden="true"></span>
</a>
</div>
</div>
</div><!-- /picto-options -->
</div><!-- /each picto -->
<div class="clearfix"></div>
</div><!-- /picto galery -->
</div><!-- /collections -->
</div><!-- /row -->
</div> <!-- /modal-body -->
</div><!-- /collections row -->
</div><!-- /modal-body -->
<div class="modal-footer">
<button class="btn btn-primary" ng-click="cancel()">{{ 'close' | translate }}</button>
</div>
</div><!-- /modal-footer -->
</div>
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 sign in to comment