浏览代码

button fixes

Nathaniel van Diepen 10 年之前
父节点
当前提交
32fedd7942
共有 2 个文件被更改,包括 13 次插入3 次删除
  1. 10 2
      data/pages/project.template
  2. 3 1
      js/index.js

+ 10 - 2
data/pages/project.template

@@ -5,7 +5,7 @@
 	{{description}}
 </div>
 <span style="font-size:small;">
-	Comments <button class="comment">{"text":"comment","id":{{id}},"type":"project","title":"Comment"}</button>
+	Comments
 </span>
 <ul>
 	{{#each comments}}
@@ -21,4 +21,12 @@
 			</div>
 		</li>
 	{{/each}}
-</ul>
+</ul>
+<a class="comment">
+	{
+		"text": "comment",
+		"id": {{id}},
+		"type": "project",
+		"title": "Comment"
+	}
+</a>

+ 3 - 1
js/index.js

@@ -340,9 +340,10 @@
 			},
 			comment: {
 				buttons: function(selector){
-					$(selector).find('button.comment').each(function(){
+					$(selector).find('.comment').each(function(){
 						var context = JSON.parse($(this).text());
 						$(this).text(context.text);
+						$(this).button();
 						$(this).click(function(){
 							render.comment.dialog(context.id,context.type,context.title);
 						});
@@ -351,6 +352,7 @@
 				dialog: function(id,type,title){
 					$('#comment').find('form').find('input[name=type]').val(type);
 					$('#comment').find('form').find('input[name=id]').val(id);
+					$('#comment').find('form').find('textarea[name=message]').val('');
 					$('#comment').dialog({
 						close: function(){
 							$('#comment').find('form').find('input[name=type]').val('');