Commit 2c3a5428 by Prem Sichanugrist

Update code base on changes in master

parent e92d8def
class CMS.Views.Week extends Backbone.View
events:
'click .module-edit': 'edit'
'click .week-edit': 'edit'
initialize: ->
@model = new CMS.Models.Week(id: @$el.data('id'))
......
......@@ -38,7 +38,7 @@
% for week in weeks:
<li class="week" data-id="${week.location.url()}">
<header>
<h1><a href="#" class="module-edit">${week.name}</a></h1>
<h1><a href="#" class="week-edit">${week.name}</a></h1>
<ul>
% if 'goals' in week.metadata:
% for goal in week.metadata['goals']:
......@@ -52,7 +52,7 @@
<ul class="modules">
% for module in week.get_children():
<li class="module" data-id="${module.location.url()}" data-type="${module.category}">
<li class="module" data-id="${module.location.url()}" data-type="${module.js_module_name()}">
<a href="#" class="module-edit">${module.name}</a>
<a href="#" class="draggable">handle</a>
</li>
......
......@@ -37,7 +37,7 @@
<ol>
% for child in module.get_children():
<li>
<a href="#" class="module-edit" data-id="${child.location.url()}" data-type="${child.type}">${child.name}</a>
<a href="#" class="module-edit" data-id="${child.location.url()}" data-type="${child.js_module_name()}">${child.name}</a>
<a href="#" class="draggable">handle</a>
</li>
%endfor
......
class @HTML
constructor: (@id) ->
@edit_box = $("##{@id} .edit-box")
@preview = $("##{@id} .preview")
constructor: (@element) ->
@edit_box = $(".edit-box", @element)
@preview = $(".preview", @element)
@edit_box.on('input', =>
@preview.empty().append(@edit_box.val())
)
......
class @Raw
constructor: (@id) ->
@edit_box = $("##{@id} .edit-box")
@preview = $("##{@id} .preview")
constructor: (@element) ->
@edit_box = $(".edit-box", @element)
@preview = $(".preview", @element)
@edit_box.on('input', =>
@preview.empty().text(@edit_box.val())
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment