fix(webhooks): sort webhooks by created, use angular-filter for sorting object

This commit is contained in:
Tyler Renelle 2014-11-19 15:25:58 -08:00
parent 5f3eef770f
commit ebebcea34b
3 changed files with 6 additions and 5 deletions

View file

@ -3,7 +3,7 @@
window.habitrpg = angular.module('habitrpg',
['ngResource', 'ngSanitize', 'userServices', 'groupServices', 'memberServices', 'challengeServices',
'authServices', 'notificationServices', 'guideServices', 'authCtrl',
'ui.bootstrap', 'ui.keypress', 'ui.router', 'chieffancypants.loadingBar', 'At', 'infinite-scroll', 'ui.select2'])
'ui.bootstrap', 'ui.keypress', 'ui.router', 'chieffancypants.loadingBar', 'At', 'infinite-scroll', 'ui.select2', 'angular.filter'])
// @see https://github.com/angular-ui/ui-router/issues/110 and https://github.com/HabitRPG/habitrpg/issues/1705
// temporary hack until they have a better solution

View file

@ -21,6 +21,7 @@
"bower_components/select2/select2.js",
"bower_components/angular-ui-select2/src/select2.js",
"bower_components/hello/dist/hello.all.min.js",
"bower_components/angular-filter/dist/angular-filter.min.js",
"bower_components/angular-bootstrap/ui-bootstrap.js",
"bower_components/angular-bootstrap/ui-bootstrap-tpls.js",

View file

@ -161,14 +161,14 @@ script(type='text/ng-template', id='partials/options.settings.api.html')
th Webhook URL
th
tbody
tr(ng-repeat="(id,webhook) in user.preferences.webhooks | orderBy:'sort'")
tr(ng-repeat="webhook in user.preferences.webhooks | toArray:true | orderBy:'sort'")
td
input(type='checkbox', ng-model='webhook.enabled', ng-change='saveWebhook(id,webhook)')
input(type='checkbox', ng-model='webhook.enabled', ng-change='saveWebhook(webhook.$key,webhook)')
td
input.form-control(type='url', ng-model='webhook.url', ng-change='webhook._editing=true', ui-keyup="{13:'saveWebhook(id,webhook)'}")
input.form-control(type='url', ng-model='webhook.url', ng-change='webhook._editing=true', ui-keyup="{13:'saveWebhook(webhook.$key,webhook)'}")
td
span.pull-left(ng-show='webhook._editing') *
a.checklist-icons(ng-click='deleteWebhook(id)')
a.checklist-icons(ng-click='deleteWebhook(webhook.$key)')
span.glyphicon.glyphicon-trash(tooltip=env.t('delete'))
tr
td(colspan=2)