summaryrefslogtreecommitdiff
path: root/assets/js/app.js
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2015-03-11 10:20:32 +0100
committerFrancois Ferrand <thetypz@gmail.com>2015-03-12 10:29:04 +0100
commit72681443a61018231eaa180a5d283e3825641219 (patch)
treef4e59358d6befb667a56ccdf907f16da4bfd8663 /assets/js/app.js
parentd91b5d4aa3acae17333eb7300bc0f6621dab11b2 (diff)
Fix flickering and column sizes.
* Avoid flickering in default view mode, by properly setting the default (horizontal-scroll) layout directly in CSS. This flickering was introduced with #675 pull request. This also fixes the layout of the public board. Javascript is now used only to activate the 'compact' mode, thus still causing a slight flickering, but in that mode only. * Use fixed-layout on the table to improve layout and rendering speed. * Slightly reduce the width of the swimlane header column, and make it fixed-width. * Slightly simplify the Javascript/jQuery code for activating compact mode. This is replaces pull request #688, with only the table layout fix, since I have no proper solution for the scrolling problem.
Diffstat (limited to 'assets/js/app.js')
-rw-r--r--assets/js/app.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/assets/js/app.js b/assets/js/app.js
index 6e6f7f34..7a3a6c96 100644
--- a/assets/js/app.js
+++ b/assets/js/app.js
@@ -153,8 +153,8 @@ k();h();g();l()}})}function n(){Kanboard.IsVisible()&&$.ajax({cache:!1,url:$("#b
g){var k=g.getAttribute("data-owner-id"),f=g.getAttribute("data-due-date"),n=g.getAttribute("data-category-id"),h=$(g).hasClass("task-board-recent");g.style.display=k!=a&&-1!=a?"none":"block";!c||""!=f&&"0"!=f||(g.style.display="none");n!=b&&-1!=b&&(g.style.display="none");d&&!h&&(g.style.display="none")});Kanboard.SetStorageItem("board_filter_"+e+"_form-user_id",a);Kanboard.SetStorageItem("board_filter_"+e+"_form-category_id",b);Kanboard.SetStorageItem("board_filter_"+e+"_filter-due-date",~~c);Kanboard.SetStorageItem("board_filter_"+
e+"_filter-recent",~~d)}function t(){var a=$("#board").data("project-id");$("#form-user_id").chosen({width:"180px",no_results_text:$("#form-user_id").data("notfound")});$("#form-category_id").chosen({width:"200px",no_results_text:$("#form-category_id").data("notfound")});$("#more-filters").chosen({width:"30%",no_results_text:$("#more-filters").data("notfound")});$(".apply-filters").change(function(a){h()});$("#form-user_id").val(Kanboard.GetStorageItem("board_filter_"+a+"_form-user_id")||-1);$("#form-user_id").trigger("chosen:updated");
$("#form-category_id").val(Kanboard.GetStorageItem("board_filter_"+a+"_form-category_id")||-1);$("#form-category_id").trigger("chosen:updated");+Kanboard.GetStorageItem("board_filter_"+a+"_filter-due-date")&&$("#more-filters option[value=filter-due-date]").attr("selected",!0);+Kanboard.GetStorageItem("board_filter_"+a+"_filter-recent")&&$("#more-filters option[value=filter-recent]").attr("selected",!0);$("#more-filters").trigger("chosen:updated");h()}function u(){jQuery(document).on("click",".filter-toggle-scrolling",
-function(a){a.preventDefault();p()});l()}function p(){var a=Kanboard.GetStorageItem("horizontal_scroll")||1;Kanboard.SetStorageItem("horizontal_scroll",0==a?1:0);l()}function l(){0==Kanboard.GetStorageItem("horizontal_scroll")?($(".filter-wide").show(),$(".filter-compact").hide(),$("#board-container").removeClass("board-container-wide").addClass("board-container-compact"),$("#board th,#board td").removeClass("board-column-wide").addClass("board-column-compact")):($(".filter-wide").hide(),$(".filter-compact").show(),
-$("#board-container").removeClass("board-container-compact").addClass("board-container-wide"),$("#board th,#board td").removeClass("board-column-compact").addClass("board-column-wide"))}var m=null;jQuery(document).ready(function(){Kanboard.Exists("board")&&(k(),t(),b(),u(),c())})}();
+function(a){a.preventDefault();p()});l()}function p(){var a=Kanboard.GetStorageItem("horizontal_scroll")||1;Kanboard.SetStorageItem("horizontal_scroll",0==a?1:0);l()}function l(){0==Kanboard.GetStorageItem("horizontal_scroll")?($(".filter-wide").show(),$(".filter-compact").hide(),$("#board-container").addClass("board-container-compact"),$("#board th").addClass("board-column-compact")):($(".filter-wide").hide(),$(".filter-compact").show(),$("#board-container").removeClass("board-container-compact"),
+$("#board th").removeClass("board-column-compact"))}var m=null;jQuery(document).ready(function(){Kanboard.Exists("board")&&(k(),t(),b(),u(),c())})}();
Kanboard.Calendar=function(){function a(a){var b=$("#calendar").data("save-url")||$("#user-calendar").data("save-url");$.ajax({cache:!1,url:b,contentType:"application/json",type:"POST",processData:!1,data:JSON.stringify({task_id:a.id,date_due:a.start.format()})})}function c(){var a=$("#user-calendar"),b=a.data("check-url"),c={start:a.fullCalendar("getView").start.format(),end:a.fullCalendar("getView").end.format(),user_id:a.data("user-id")},d;for(d in c)b+="&"+d+"="+c[d];$.getJSON(b,function(b){a.fullCalendar("removeEvents");
a.fullCalendar("addEventSource",b);a.fullCalendar("rerenderEvents")})}function b(a){var b=$("#calendar"),c=b.data("check-url"),d={start:b.fullCalendar("getView").start.format(),end:b.fullCalendar("getView").end.format()};jQuery.extend(d,a);for(var e in d)c+="&"+e+"="+d[e];$.getJSON(c,function(a){b.fullCalendar("removeEvents");b.fullCalendar("addEventSource",a);b.fullCalendar("rerenderEvents")})}function d(){var a=Kanboard.GetStorageItem(f);if(""!==a){var a=JSON.parse(a),c;for(c in a)$("select[name="+
c+"]").val(a[c])}b(a||{});$(".calendar-filter").change(e)}function e(){var a={};$(".calendar-filter").each(function(){a[$(this).attr("name")]=$(this).val()});Kanboard.SetStorageItem(f,JSON.stringify(a));b(a)}var f="";jQuery(document).ready(function(){Kanboard.Exists("calendar")?(f="calendar_filters_"+$("#calendar").data("project-id"),$("#calendar").fullCalendar({lang:$("body").data("js-lang"),editable:!0,eventLimit:!0,defaultView:"month",header:{left:"prev,next today",center:"title",right:"month,agendaWeek,agendaDay"},