Skip to content

Commit fdbb279

Browse files
committed
Merge pull request #145 from taitems/develop
Merge changes and fixes from develop branch
2 parents 7aa2080 + f1a7c4e commit fdbb279

File tree

3 files changed

+38
-29
lines changed

3 files changed

+38
-29
lines changed

index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<meta charset="utf-8">
66
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1">
77
<link href="css/style.css" type="text/css" rel="stylesheet">
8-
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" type="text/css">
8+
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet" type="text/css">
99
<link href="http://taitems.github.com/UX-Lab/core/css/prettify.css" rel="stylesheet" type="text/css">
1010
<style type="text/css">
1111
body {
@@ -30,7 +30,7 @@
3030
table th:first-child {
3131
width: 150px;
3232
}
33-
/* Bootstrap 3.0 re-reset */
33+
/* Bootstrap 3.x re-reset */
3434
.fn-gantt *,
3535
.fn-gantt *:after,
3636
.fn-gantt *:before {
@@ -68,7 +68,7 @@ <h2>Contributors</h2>
6868
<h2>
6969
Example
7070
</h2>
71-
71+
7272
<div class="gantt"></div>
7373

7474

@@ -437,7 +437,7 @@ <h2>
437437

438438
<script src="js/jquery.min.js"></script>
439439
<script src="js/jquery.fn.gantt.js"></script>
440-
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
440+
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
441441
<script src="http://taitems.github.com/UX-Lab/core/js/prettify.js"></script>
442442
<script>
443443
$(function() {

js/jquery.fn.gantt.js

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
core.scrollPanel(element, 0);
294294
// or, scroll the grid to the left most date in the panel
295295
} else {
296-
if ((element.hPosition !== 0)) {
296+
if (element.hPosition !== 0) {
297297
if (element.scaleOldWidth) {
298298
mLeft = ($dataPanel.width() - $rightPanel.width());
299299
hPos = mLeft * element.hPosition / element.scaleOldWidth;
@@ -306,10 +306,8 @@
306306
$dataPanel.css({ "margin-left": element.hPosition + "px" });
307307
element.scrollNavigation.panelMargin = element.hPosition;
308308
}
309-
core.repositionLabel(element);
310-
} else {
311-
core.repositionLabel(element);
312309
}
310+
core.repositionLabel(element);
313311
}
314312

315313
$dataPanel.css({ height: $leftPanel.height() });
@@ -329,7 +327,7 @@
329327
$.each(element.data, function (i, entry) {
330328
if (i >= element.pageNum * settings.itemsPerPage && i < (element.pageNum * settings.itemsPerPage + settings.itemsPerPage)) {
331329
entries.push('<div class="row name row' + i + (entry.desc ? '' : ' fn-wide') + '" id="rowheader' + i + '" offset="' + i % settings.itemsPerPage * tools.getCellSize() + '">');
332-
entries.push('<span class="fn-label' + (entry.cssClass ? ' ' + entry.cssClass : '') + '">' + entry.name + '</span>');
330+
entries.push('<span class="fn-label' + (entry.cssClass ? ' ' + entry.cssClass : '') + '">' + (entry.name || '') + '</span>');
333331
entries.push('</div>');
334332

335333
if (entry.desc) {
@@ -770,7 +768,7 @@
770768
}))
771769
.append($('<div class="page-number"/>')
772770
.append($('<span/>')
773-
.html(element.pageNum + 1 + ' of ' + element.pageCount)))
771+
.html(element.pageNum + 1 + ' / ' + element.pageCount)))
774772
.append($('<button type="button" class="nav-link nav-page-next"/>')
775773
.html('&gt;')
776774
.click(function () {
@@ -1168,20 +1166,18 @@
11681166
var $dataPanel = $rightPanel.find(".dataPanel");
11691167
var rightPanelWidth = $rightPanel.width();
11701168
var dataPanelWidth = $dataPanel.width();
1171-
1169+
var shift = function () {
1170+
core.repositionLabel(element);
1171+
};
11721172
switch (val) {
11731173
case "begin":
1174-
$dataPanel.animate({
1175-
"margin-left": "0px"
1176-
}, "fast", function () { core.repositionLabel(element); });
1174+
$dataPanel.animate({ "margin-left": "0px" }, "fast", shift);
11771175
element.scrollNavigation.panelMargin = 0;
11781176
break;
11791177
case "end":
11801178
var mLeft = dataPanelWidth - rightPanelWidth;
11811179
element.scrollNavigation.panelMargin = mLeft * -1;
1182-
$dataPanel.animate({
1183-
"margin-left": "-" + mLeft + "px"
1184-
}, "fast", function () { core.repositionLabel(element); });
1180+
$dataPanel.animate({ "margin-left": "-" + mLeft + "px" }, "fast", shift);
11851181
break;
11861182
case "now":
11871183
if (!element.scrollNavigation.canScroll || !$dataPanel.find(".today").length) {
@@ -1196,23 +1192,20 @@
11961192
} else if (val < max_left) {
11971193
val = max_left;
11981194
}
1199-
$dataPanel.animate({
1200-
"margin-left": val + "px"
1201-
}, "fast", core.repositionLabel(element));
1195+
$dataPanel.animate({ "margin-left": val + "px" }, "fast", shift);
12021196
element.scrollNavigation.panelMargin = val;
12031197
break;
12041198
default:
12051199
var max_left = (dataPanelWidth - rightPanelWidth) * -1;
12061200
var cur_marg = $dataPanel.css("margin-left").replace("px", "");
12071201
var val = parseInt(cur_marg, 10) + val;
12081202
if (val <= 0 && val >= max_left) {
1209-
$dataPanel.animate({
1210-
"margin-left": val + "px"
1211-
}, "fast", core.repositionLabel(element));
1203+
$dataPanel.animate({ "margin-left": val + "px" }, "fast", shift);
12121204
}
12131205
element.scrollNavigation.panelMargin = val;
12141206
break;
12151207
}
1208+
core.synchronizeScroller(element);
12161209
},
12171210

12181211
// Navigate to a specific page
@@ -1428,11 +1421,8 @@
14281421
$(element).append(element.loader);
14291422
setTimeout(fn, 500);
14301423

1431-
} else {
1432-
if (element.loader) {
1433-
element.loader.remove();
1434-
}
1435-
element.loader = null;
1424+
} else if (element.loader) {
1425+
element.loader.detach();
14361426
}
14371427
}
14381428
};

0 commit comments

Comments
 (0)