From 54af5e8bd458e29e1f044a44f5e684ddfa3d6014 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 7 Mar 2013 19:15:30 +0800 Subject: [PATCH] insert and remove columns --- app/assets/javascripts/orbitdesktop.js | 80 ++++++++++++++++---------- 1 file changed, 50 insertions(+), 30 deletions(-) diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 2a50c3426..f766802fa 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -334,6 +334,55 @@ var orbitDesktop = function(dom){ }) } } + this.insert_new_column = function(index){ + var column_container = $("div[container=true] div.overview"),layout = column_container.attr("content-layout"),base_width = parseInt(column_container.attr("base-width")),column; + var i = (index == 0? 0 : index-1); + var previous_column = column_container.find(".column").eq(i); + if(previous_column.length == 0)return false; + switch(layout){ + case "datalist": + column = $("