codecombat/test/demo/views/achievement/AchievementGet.demo.coffee

33 lines
851 B
CoffeeScript
Raw Normal View History

CocoModel = require 'models/CocoModel'
RootView = require 'views/kinds/RootView'
2014-06-17 15:42:27 -04:00
utils = require 'lib/utils'
Achievement = require 'models/Achievement'
EarnedAchievement = require 'models/EarnedAchievement'
module.exports = ->
me.set 'points', 48
2014-07-06 17:16:00 -04:00
unlockableObj = fixtures.DungeonArenaStarted
2014-06-17 15:42:27 -04:00
earnedUnlockableObj =
earnedPoints: 3
notified: false
unlockable = new Achievement unlockableObj
earnedUnlockable = new EarnedAchievement earnedUnlockableObj
console.log currentView
data = currentView.createNotifyData unlockable, earnedUnlockable
imageURL = '/images/achievements/swords-01.png'
2014-06-17 15:42:27 -04:00
data.image = $("<img src='#{imageURL}' />")
options =
autoHideDelay: 10000
globalPosition: 'bottom right'
showDuration: 400
style: 'achievement'
autoHide: false
clickToHide: false
$.notify data, options