This commit is contained in:
Jaime Pillora
2014-01-18 20:59:43 +11:00
parent 0b830a7040
commit c32169f889
2 changed files with 14 additions and 13 deletions
+8 -9
View File
@@ -1,7 +1,7 @@
App = window.App = App or {}
window.BuildController = ($scope) ->
window.BuildController = ($scope,$timeout) ->
$scope.premadeStyles = [
{
@@ -19,30 +19,25 @@ window.BuildController = ($scope) ->
}
]
$(".build-tool-loading").hide()
$(".build-tool-toggle").show()
App.buildTool = $scope
$scope.styles = []
$scope.addStyle = (code, premade) ->
$scope.styles.push { active: true, code, premade:premade }
#use one of the examples
$scope.addStyle $(".happyblue-example").text()
$scope.settings = {
minify: false
default: $scope.styles[0]
}
$scope.loadStyle = ->
style = $scope.premadeStyle
return unless style
$scope.premadeStyle = null
baseUrl = "dist/styles/#{style.name}/notify-#{style.name}"
$.ajax
@@ -62,6 +57,10 @@ window.BuildController = ($scope) ->
$scope.$digest()
return
#load bootstrap
$scope.premadeStyle = $scope.premadeStyles[0]
$scope.loadStyle
#angular has loaded
$scope.toggle = ->
$(".build-tool-toggle").toggleClass('active')
@@ -123,7 +122,7 @@ window.BuildController = ($scope) ->
obj = if className is 'base' then 'no class' else "'#{className}'"
if style.premade
if style.premade?.test
obj = style.premade.test obj
try