diff --git a/module/common/view/kanban.html.php b/module/common/view/kanban.html.php
index 43c429cc2c..6b76284996 100644
--- a/module/common/view/kanban.html.php
+++ b/module/common/view/kanban.html.php
@@ -381,9 +381,7 @@ function affixKanbanHeader($kanbanBoard, affixed)
$kanbanBoard.css('padding-top', affixed ? $header.outerHeight() : '');
}
-/**
- * Update kanban affix state for all boards in page
- */
+/** Update kanban affix state for all boards in page */
function updateKanbanAffixState()
{
var $boards = $('.kanban-board');
@@ -409,17 +407,29 @@ function updateKanbanAffixState()
if($currentAffixedBoard) affixKanbanHeader($currentAffixedBoard, true);
}
+/** Try to update kanban affix state */
+function tryUpdateKanbanAffix()
+{
+ if(window.updateKanbanAffixTimer) $.zui.clearAsap(window.updateKanbanAffixTimer);
+ window.updateKanbanAffixTimer = $.zui.asap(function()
+ {
+ updateKanbanAffixState();
+ window.updateKanbanAffixTimer = null;
+ });
+}
+
/* Kanban color list for lane name */
if(!window.kanbanColorList) window.kanbanColorList = ['#32C5FF', '#006AF1', '#9D28B2', '#FF8F26', '#7FBB00', '#424BAC', '#66c5f8', '#EC2761'];
/* Set default options to kanban component */
$.extend($.fn.kanban.Constructor.DEFAULTS,
{
- readonly: true,
- maxColHeight: 260,
- itemRender: renderKanbanItem,
- showCount: true,
- showZeroCount: true,
+ readonly: true,
+ maxColHeight: 260,
+ itemRender: renderKanbanItem,
+ showCount: true,
+ showZeroCount: true,
+ fluidBoardWidth: true,
onRenderLaneName: function($name, lane, $kanban, columns, kanban)
{
var color = kanbanColorList[lane.$index % kanbanColorList.length];
@@ -442,29 +452,13 @@ $.extend($.fn.kanban.Constructor.DEFAULTS,
},
onCreate: function(kanban)
{
- kanban.$.on('scroll', updateKanbanAffixState);
- updateKanbanAffixState();
+ kanban.$.on('scroll', tryUpdateKanbanAffix);
+ tryUpdateKanbanAffix();
}
});
$(function()
{
- /* Update kanban affix state on window resize or scroll */
- var updateTimer;
- var updateCallback = function()
- {
- updateKanbanAffixState();
- updateTimer = null;
- };
- $(window.kanbanAffixContainer || window).on('scroll resize', function(e)
- {
- if(updateTimer)
- {
- if(window.requestAnimationFrame) cancelAnimationFrame(updateTimer);
- else clearTimeout(updateTimer);
- }
- if(window.requestAnimationFrame) updateTimer = requestAnimationFrame(updateCallback);
- else updateTimer = setTimeout(updateCallback, 50);
- });
+ $(window.kanbanAffixContainer || window).on('scroll resize', tryUpdateKanbanAffix);
});
diff --git a/module/execution/js/kanban.js b/module/execution/js/kanban.js
index 8ce3c9e1f3..236bce689a 100644
--- a/module/execution/js/kanban.js
+++ b/module/execution/js/kanban.js
@@ -750,7 +750,7 @@ $(function()
maxColWidth: 240,
showCount: true,
showZeroCount: true,
- fluidBoardWidth: true,
+ fluidBoardWidth: false,
droppable:
{
target: findDropColumns,
@@ -833,7 +833,7 @@ $(function()
{
$.get(createLink('execution', 'ajaxUpdateKanban', "executionID=" + executionID + "&entertime=" + entertime + "&browseType=" + browseType + "&groupBy=" + groupBy), function(data)
{
- if(data)
+ if(data)
{
kanbanGroup = $.parseJSON(data);
if(groupBy == 'default')
diff --git a/www/js/zui/kanban/min.js b/www/js/zui/kanban/min.js
index ae8555ed7d..bfd1abbf0e 100644
--- a/www/js/zui/kanban/min.js
+++ b/www/js/zui/kanban/min.js
@@ -4,4 +4,4 @@
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2021 cnezsoft.com; Licensed MIT
*/
-!function(){"use strict";function a(a,n){return e&&!n?requestAnimationFrame(a):setTimeout(a,n||0)}function n(a){return e?cancelAnimationFrame(a):void clearTimeout(a)}var e="function"==typeof window.requestAnimationFrame;$.zui({asap:a,clearAsap:n})}(),function(a){"use strict";function n(n,e,t){"boolean"==typeof e&&(t=e,e=null);var i=a(n),r=a(e?e:window),d=r.scrollTop(),o=d+r.height(),s=i.offset().top,l=s+i.height();return t?dl:s<=o&&l>=d}var e="zui.virtualRender",t=function(n,i){"function"==typeof i&&(i={render:i});var r=this;r.name=e,r.$=a(n),r.options=i=a.extend({},t.DEFAULTS,this.$.data(),i),r.rendered=!1;var d=r.options.conatiner,o=a(d?d:window);r.tryRender()||(r.$container=o,r.scrollListener=r.tryRender.bind(r),i.pendingClass&&r.$.addClass(i.pendingClass),o.on("scroll",r.scrollListener))};t.prototype.tryRender=function(){var e=this;return!(e.rendered||!n(e.$))&&(e.renderTaskID&&a.zui.clearAsap(e.renderTaskID),e.renderTaskID=a.zui.asap(function(){e.renderTaskID=null;var a=e.options.render(e.$);a!==!1&&(e.rendered=!0,e.destroy())},e.options.delay),!0)},t.prototype.destroy=function(){var n=this;n.renderTaskID&&a.zui.clearAsap(n.renderTaskID),n.scrollListener&&(n.$container.off("scroll",n.scrollListener),n.scrollListener=null);var t=n.options.pendingClass;t&&n.$.removeClass(t),n.$.removeData(e)},t.DEFAULTS={pendingClass:"virtual-pending"},a.fn.virtualRender=function(n){return this.each(function(){var i=a(this),r=i.data(e),d=n;if(r){if("string"==typeof n)return r[n]();r.destroy()}i.data(e,r=new t(this,d))})},a.zui.isScrolledIntoView=n}(jQuery),function(a){"use strict";var n="zui.kanban",e="object"==typeof CSS&&CSS.supports("display","flex"),t=function(i,r){var d=(a.zui.uuid(),this);d.name=n,d.$=a(i).addClass("kanban"),d.options=r=a.extend({},t.DEFAULTS,this.$.data(),r),r.useFlex&&!e&&(r.useFlex=!1),d.$.toggleClass("no-flex",!r.useFlex).toggleClass("use-flex",!!r.useFlex);var o=!!a.fn.virtualRender&&d.options.virtualize;if(o&&("object"!=typeof o&&(o={lane:!0}),d.virtualize=a.extend({},o)),d.data=r.data||[],d.timers={},d.render(d.data),r.onAction){var s=function(n){var e=a(this);r.onAction(e.data("action"),e,n,d)};d.$.on("click",".action",s).on("dblclick",".action-dbc",s)}if("auto"===r.droppable&&(r.droppable=!r.readonly),r.droppable){var l=0,c={dropOnMouseleave:!0,selector:".kanban-item",target:'.kanban-lane-col:not([data-type="EMPTY"])',drop:function(a){"function"==typeof r.droppable?r.droppable(a):r.onAction&&r.onAction("dropItem",a.element,a,d)},start:function(n){d.$.addClass("kanban-dragging"),l&&clearTimeout(l),l=setTimeout(function(){a(n.shadowElement).addClass("in"),l=0},50)},always:function(){d.$.removeClass("kanban-dragging"),l&&(clearTimeout(l),l=0)}};"object"==typeof r.droppable&&a.extend(c,r.droppable),d.$.droppable(c)}if(!r.useFlex){var h=0;a(window).on("resize",function(){h&&a.zui.clearAsap(h),h=a.zui.asap(function(){h=0,d.adjustSize()})})}r.onCreate&&r.onCreate(d)};t.prototype.render=function(a){var n=this;a&&(n.data=a),n.data&&!Array.isArray(n.data)&&(n.data=[n.data]);var t=n.data||[];n.options.beforeRender&&n.options.beforeRender(n,t),n.$.toggleClass("kanban-readonly",!!n.options.readonly).toggleClass("kanban-no-lane-name",!!n.options.noLaneName),n.$.children(".kanban-board").addClass("kanban-expired");for(var i=0;i-1){var i=e.data[t];n=a.extend(i,n),e.data[t]=n}else e.data.push(n)}n.id||(n.id=a.zui.uuid());var r=n.id,d=e.options,o=e.$,s=o.children('.kanban-board[data-id="'+r+'"]');s.length?s.removeClass("kanban-expired"):s=a('').appendTo(o);for(var l=n.columns,c=d.noLaneName?0:d.laneNameWidth,h=0,u={},p=!1,b=0;b0&&d.subLaneSpace&&(y.$height+=d.subLaneSpace)}}else for(var w=y.items||y.cards||{},L=0;L