ListView BugFix

This commit is contained in:
Curtis SerVaas
2014-08-06 20:39:13 -04:00
parent a04d4f3148
commit bfb370252a
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -9,7 +9,6 @@ $(function(){
//(remove the content of everything else)
//remove the classes.
$("body").on("blur", "#marked-mathjax-input", function(){
debugger;
var editor = $("#marked-mathjax-input"); //(this is the text-area)
var wrapper = editor.closest(".hoverWrap");
var text = editor.siblings(".Current").html();
@@ -142,7 +141,8 @@ voInitializer = function(that, event){
vo.thisId = vo.thisLI.attr("data-id"); //data-id.
vo.thisIndex = vo.thisLI.index(); //returns -1 if there's no match.
vo.thisModel = nodesCollection.findWhere({_id: vo.thisId});
vo.thisView = vo.thisModel.get("views")[0]; //split screen isn't implemented yet.
vo.thisView = vo.thisModel.get("views").slice(-1)[0]; //we're assuming a tree.
//(also, I'm not garbage collecting extra views when you zoom in/out, so we have to grab last element).
//alert(thisIndex)
//thisModel = nodesCollection.get(thisId);
+1
View File
@@ -162,6 +162,7 @@
if ( null != this.currentView ) {
this.currentView.undelegateEvents();
}
this.currentView = view;
$("textarea").textareaAutoExpand();
+3 -3
View File
@@ -23,7 +23,7 @@ var showView = Backbone.View.extend({
var id = that.model.get("_id");
var text = that.model.get("text");
var html = that.createUIBullet(id, text, that.depth);
var html = that.createUIBullet(id, text, that.depth);
that.$el.children("ul").addClass("collapsed");
that.$el.attr("data-depth", that.depth);
that.$el.attr("data-id", id);
@@ -80,7 +80,7 @@ var showView = Backbone.View.extend({
//text-area => MarkDownEditor.
createMarkDownBullet: function(){
var that = this;
var textarea = that.$el.find("textarea");
var textarea = that.$el.children(".hoverWrap").children("textarea");
var newDiv = "<div><p>" + textarea.val() + "</p></div>";
textarea.remove();
@@ -101,7 +101,7 @@ var showView = Backbone.View.extend({
var buffer = '<div class="preview content" id="marked-mathjax-preview-buffer" style="display:none; position:absolute; top:0; left: 0"> </div>';
var textareaInput = '<textarea id="marked-mathjax-input" onkeyup="Preview.Update()" name="comment" "autofocus"></textarea>';
hoverWrap.append(buffer+textareaInput);
debugger;
setTimeout(function(){
Preview.Init();
Preview.Update();