Commit 494e688c authored by Peter Harrison's avatar Peter Harrison

[#35] Modification to View javascript to havea default view

automagically.
parent 7adff2a2
var view = { var view = {
views: false, views: false,
curentview: false, currentview: false,
setViewsForCurrentBoard: function(views) { setViewsForCurrentBoard: function(views) {
if (views == null) if (views == null)
return; return;
view.views = views; view.views = views;
var data = [], var data = [],
$wrapper = $('#board-control-options-wrapper'), $wrapper = $('#board-control-options-wrapper'),
$viewname = $wrapper.find('input[name="view-name"]'); $viewname = $wrapper.find('input[name="view-name"]');
...@@ -16,6 +16,9 @@ var view = { ...@@ -16,6 +16,9 @@ var view = {
jQuery.each(view.views, function(i, v) { jQuery.each(view.views, function(i, v) {
data.push({id: i, text: v.name}); data.push({id: i, text: v.name});
if(!view.currentview){
view.currentview = i;
}
}); });
data.sort(function(a,b) { data.sort(function(a,b) {
...@@ -26,7 +29,7 @@ var view = { ...@@ -26,7 +29,7 @@ var view = {
$viewname.select2({ $viewname.select2({
placeholder: "Select a View", placeholder: "Select a View",
allowClear: true, allowClear: false,
data: data, data: data,
width: "240px", width: "240px",
minimumResultsForSearch: -1, minimumResultsForSearch: -1,
......
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