forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTotalColumnHeaderView.coffee
More file actions
49 lines (36 loc) · 1.05 KB
/
Copy pathTotalColumnHeaderView.coffee
File metadata and controls
49 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
define [
'jquery'
'Backbone'
'jst/gradebook/total_column_header'
], ($, Backbone, template) ->
class TotalColumnHeaderView extends Backbone.View
el: '#total_column_header'
events:
"click .toggle_percent": "togglePercent"
"click .move_column": "moveColumn"
template: template
togglePercent: =>
@options.toggleShowingPoints()
false
switchTotalDisplay: (showAsPoints) =>
@options.showingPoints = showAsPoints
@render()
moveColumn: =>
@options.moveTotalColumn()
@render()
false
render: ->
# the menu doesn't live in @$el, so remove it manually
@$menu.remove() if @$menu
super()
@$menu = @$el.find('.gradebook-header-menu')
@$el.find('#total_dropdown').kyleMenu
noButton: true
appendMenuTo: '#gradebook_grid'
@$menu.css('width', '150')
this
toJSON: ->
json =
showingPoints: @options.showingPoints
weightedGroups: @options.weightedGroups
totalColumnInFront: @options.totalColumnInFront