Use ui-sref instead of ng-click (with $state.go).

For agenda item list and detail template.
This commit is contained in:
Emanuel Schuetze 2016-09-17 11:44:33 +02:00
parent ca9c946b6f
commit 8e3463b1df
3 changed files with 6 additions and 20 deletions

View File

@ -142,16 +142,6 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$scope.newDialog = function () {
ngDialog.open(CustomslideForm.getDialog());
};
// open edit dialog
$scope.editDialog = function (item) {
$state.go(item.content_object.collection.replace('/','.')+'.detail.update',
{id: item.content_object.id});
};
// detail view of related item (content object)
$scope.open = function (item) {
$state.go(item.content_object.collection.replace('/','.')+'.detail',
{id: item.content_object.id});
};
// cancel QuickEdit mode
$scope.cancelQuickEdit = function (item) {
// revert all changes by restore (refresh) original item object from server
@ -264,12 +254,6 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
$scope.speakers = $filter('orderBy')(item.speakers, 'weight');
});
// go to detail view of related item (content object)
$scope.open = function (item) {
$state.go(item.content_object.collection.replace('/','.')+'.detail',
{id: item.content_object.id});
};
// close/open list of speakers of current item
$scope.closeList = function (listClosed) {
item.speaker_list_closed = listClosed;

View File

@ -5,7 +5,7 @@
<i class="fa fa-angle-double-left fa-lg"></i>
<translate>Agenda</translate>
</a>
<a href="" ng-click="open(item)" class="btn btn-sm btn-default">
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail({id: item.content_object.id})" class="btn btn-sm btn-default">
<i class="fa fa-angle-double-left fa-lg"></i>
{{ item.getContentResource().verboseName | translate }}
</a>

View File

@ -169,7 +169,7 @@
<td ng-if="!item.quickEdit" ng-mouseover="item.hover=true" ng-mouseleave="item.hover=false"
style="padding-left: calc(8px + {{ item.parentCount }}*15px)">
<strong>
<a ng-show="isAllowedToSeeOpenLink(item)" href="" ng-click="open(item)">
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail({id: item.content_object.id})" ng-show="isAllowedToSeeOpenLink(item)">
{{ item.getListViewTitle() }}
</a>
<span ng-hide="isAllowedToSeeOpenLink(item)">
@ -183,7 +183,8 @@
<div os-perms="agenda.can_see" class="hoverActions" ng-class="{'hiddenDiv': !item.hover}">
<a ui-sref="agenda.item.detail({id: item.id})" translate>List of speakers</a>
<span os-perms="agenda.can_manage"> |
<a href="" ng-click="editDialog(item)" translate>Edit</a> |
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail.update({id: item.content_object.id})"
translate>Edit</a> |
<a href="" ng-click="item.quickEdit=true" translate>QuickEdit</a> |
<a href="" class="text-danger"
ng-bootbox-confirm="{{ 'Are you sure you want to delete this entry?' | translate }}<br>
@ -233,7 +234,8 @@
<button ng-click="save(item)" class="btn btn-primary" translate>
Update
</button>
<a href="" ng-click="editDialog(item)" class="pull-right"><translate>Edit ...</translate></a>
<a ui-sref="{{ item.content_object.collection.replace('/','.') }}.detail.update({id: item.content_object.id})"
class="pull-right"><translate>Edit ...</translate></a>
</div>
</table>
<uib-pagination ng-show="itemsFiltered.length > itemsPerPage" total-items="itemsFiltered.length" items-per-page="itemsPerPage" ng-model="currentPage"