Commit 2c3a5428 by Prem Sichanugrist

Update code base on changes in master

parent e92d8def
class CMS.Views.Week extends Backbone.View class CMS.Views.Week extends Backbone.View
events: events:
'click .module-edit': 'edit' 'click .week-edit': 'edit'
initialize: -> initialize: ->
@model = new CMS.Models.Week(id: @$el.data('id')) @model = new CMS.Models.Week(id: @$el.data('id'))
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
% for week in weeks: % for week in weeks:
<li class="week" data-id="${week.location.url()}"> <li class="week" data-id="${week.location.url()}">
<header> <header>
<h1><a href="#" class="module-edit">${week.name}</a></h1> <h1><a href="#" class="week-edit">${week.name}</a></h1>
<ul> <ul>
% if 'goals' in week.metadata: % if 'goals' in week.metadata:
% for goal in week.metadata['goals']: % for goal in week.metadata['goals']:
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<ul class="modules"> <ul class="modules">
% for module in week.get_children(): % 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="module-edit">${module.name}</a>
<a href="#" class="draggable">handle</a> <a href="#" class="draggable">handle</a>
</li> </li>
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<ol> <ol>
% for child in module.get_children(): % for child in module.get_children():
<li> <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> <a href="#" class="draggable">handle</a>
</li> </li>
%endfor %endfor
......
class @HTML class @HTML
constructor: (@id) -> constructor: (@element) ->
@edit_box = $("##{@id} .edit-box") @edit_box = $(".edit-box", @element)
@preview = $("##{@id} .preview") @preview = $(".preview", @element)
@edit_box.on('input', => @edit_box.on('input', =>
@preview.empty().append(@edit_box.val()) @preview.empty().append(@edit_box.val())
) )
......
class @Raw class @Raw
constructor: (@id) -> constructor: (@element) ->
@edit_box = $("##{@id} .edit-box") @edit_box = $(".edit-box", @element)
@preview = $("##{@id} .preview") @preview = $(".preview", @element)
@edit_box.on('input', => @edit_box.on('input', =>
@preview.empty().text(@edit_box.val()) @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