Patching one test and simplifying the modifications to order cycle tooltip

This commit is contained in:
Will Marshall
2014-04-07 14:10:22 +10:00
parent 1c22a2c848
commit 902eefa8bb
4 changed files with 17 additions and 9 deletions

View File

@@ -1,10 +1,15 @@
Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, OrderCycle, $tour) ->
Darkswarm.controller "OrderCycleCtrl", ($scope, $rootScope, OrderCycle, $timeout) ->
$scope.order_cycle = OrderCycle.order_cycle
$scope.OrderCycle = OrderCycle
$scope.changeOrderCycle = ->
$tour.end()
OrderCycle.push_order_cycle()
$timeout ->
$("#order_cycle_id").trigger("closeTrigger")
if !OrderCycle.selected()
$tour.start()
# Timeout forces this to be evaluated after everything is loaded
# This is a hack. We should probably write our own "popover" directive
# That takes an expression instead of a trigger, and binds to that
$timeout =>
if !$scope.OrderCycle.selected()
$("#order_cycle_id").trigger("openTrigger")

View File

@@ -1,4 +1,6 @@
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation']).config ($httpProvider) ->
window.Darkswarm = angular.module("Darkswarm", ["ngResource", "filters", 'mm.foundation']).config ($httpProvider, $tooltipProvider) ->
$httpProvider.defaults.headers.post['X-CSRF-Token'] = $('meta[name="csrf-token"]').attr('content')
$httpProvider.defaults.headers['common']['X-Requested-With'] = 'XMLHttpRequest'
$httpProvider.defaults.headers.common.Accept = "application/json, text/javascript, */*"
$tooltipProvider.setTriggers( 'openTrigger': 'closeTrigger' )