From ebebcea34b9948fa211fccaa112485b99334721b Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Wed, 19 Nov 2014 15:25:58 -0800 Subject: [PATCH] fix(webhooks): sort webhooks by created, use angular-filter for sorting object --- public/js/app.js | 2 +- public/manifest.json | 1 + views/options/settings.jade | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/js/app.js b/public/js/app.js index cf04bd8373..9f30a29483 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -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 diff --git a/public/manifest.json b/public/manifest.json index ad86285390..2e8a5b4ee1 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -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", diff --git a/views/options/settings.jade b/views/options/settings.jade index 53d689d0f3..99c94f4dc2 100644 --- a/views/options/settings.jade +++ b/views/options/settings.jade @@ -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)