mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-20 00:37:26 +00:00
Changed new subscription dialog to use tom-select from select2
fixed z-index, text-alignment in the dropdown menu to left in new subscription modal, replaced click_link with page.find().click in subscription specs, removed href in subscription index
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
angular.module("admin.subscriptions").directive 'newSubscriptionDialog', ($rootScope, $compile, $window, $templateCache, DialogDefaults, shops) ->
|
||||
restrict: 'A'
|
||||
scope: true
|
||||
link: (scope, element, attr) ->
|
||||
scope.submitted = false
|
||||
scope.shops = shops
|
||||
scope.shop_id = null
|
||||
|
||||
scope.newSubscription = ->
|
||||
scope.new_subscription_form.$setPristine()
|
||||
scope.submitted = true
|
||||
if scope.shop_id?
|
||||
$window.location.href = "/admin/subscriptions/new?subscription[shop_id]=#{scope.shop_id}"
|
||||
return
|
||||
|
||||
# Compile modal template
|
||||
template = $compile($templateCache.get('admin/new_subscription_dialog.html'))(scope)
|
||||
|
||||
# Set Dialog options
|
||||
template.dialog(DialogDefaults)
|
||||
|
||||
# Link opening of dialog to click event on element
|
||||
element.bind 'click', (e) ->
|
||||
if shops.length == 1
|
||||
scope.shop_id = shops[0].id
|
||||
scope.newSubscription()
|
||||
else
|
||||
template.dialog('open')
|
||||
$rootScope.$evalAsync()
|
||||
Reference in New Issue
Block a user