Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added titles to control buttons #185

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
-moz-box-sizing: content-box;
box-sizing: content-box;
}
code {
white-space: pre-line;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -221,6 +224,31 @@ <h2 id="config">
string
</td>
</tr>

<tr>
<td>
<code>buttons</code></td>
<td>
object <code>
{
navBegin: "To beginning",
navEnd: "To end",
navNextDay: "Next day",
navNextPage: "Next page",
navNextWeek: "Next week",
navNow: "Now",
navPrevDay: "Previous day",
navPrevPage: "Previous page",
navPrevWeek: "Previous week",
navZoomIn: "Zoom in",
navZoomOut: "Zoom out"
}
</code>
</td>
<td>
An object containing localized navigation buttons description
</td>
</tr>
<tr>
<td>
<code>onItemClick</code>
Expand Down
33 changes: 33 additions & 0 deletions js/jquery.fn.gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@
dow: ["S", "M", "T", "W", "T", "F", "S"],
months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
waitText: "Please wait...",
buttons: {
navBegin: "To beginning",
navEnd: "To end",
navNextDay: "Next day",
navNextPage: "Next page",
navNextWeek: "Next week",
navNow: "Now",
navPrevDay: "Previous day",
navPrevPage: "Previous page",
navPrevWeek: "Previous week",
navZoomIn: "Zoom in",
navZoomOut: "Zoom out"
},
// navigation
navigate: "buttons",
scrollToToday: true,
Expand Down Expand Up @@ -803,6 +816,7 @@
.append($('<div class="nav-slider" />')
.append($('<div class="nav-slider-left" />')
.append($('<button type="button" class="nav-link nav-page-back"/>')
.attr('title', settings.buttons.navPrevPage)
.html('&lt;')
.click(function () {
core.navigatePage(element, -1);
Expand All @@ -811,16 +825,19 @@
.append($('<span/>')
.html(element.pageNum + 1 + ' / ' + element.pageCount)))
.append($('<button type="button" class="nav-link nav-page-next"/>')
.attr('title', settings.buttons.navNextPage)
.html('&gt;')
.click(function () {
core.navigatePage(element, 1);
}))
.append($('<button type="button" class="nav-link nav-now"/>')
.attr('title', settings.buttons.navNow)
.html('&#9679;')
.click(function () {
core.navigateTo(element, 'now');
}))
.append($('<button type="button" class="nav-link nav-prev-week"/>')
.attr('title', settings.buttons.navPrevWeek)
.html('&lt;&lt;')
.click(function () {
if (settings.scale === 'hours') {
Expand All @@ -834,6 +851,7 @@
}
}))
.append($('<button type="button" class="nav-link nav-prev-day"/>')
.attr('title', settings.buttons.navPrevDay)
.html('&lt;')
.click(function () {
if (settings.scale === 'hours') {
Expand Down Expand Up @@ -864,6 +882,7 @@
)
.append($('<div class="nav-slider-right" />')
.append($('<button type="button" class="nav-link nav-next-day"/>')
.attr('title', settings.buttons.navNextDay)
.html('&gt;')
.click(function () {
if (settings.scale === 'hours') {
Expand All @@ -877,6 +896,7 @@
}
}))
.append($('<button type="button" class="nav-link nav-next-week"/>')
.attr('title', settings.buttons.navNextWeek)
.html('&gt;&gt;')
.click(function () {
if (settings.scale === 'hours') {
Expand All @@ -890,11 +910,13 @@
}
}))
.append($('<button type="button" class="nav-link nav-zoomIn"/>')
.attr('title', settings.buttons.navZoomIn)
.html('&#43;')
.click(function () {
core.zoomInOut(element, -1);
}))
.append($('<button type="button" class="nav-link nav-zoomOut"/>')
.attr('title', settings.buttons.navZoomOut)
.html('&#45;')
.click(function () {
core.zoomInOut(element, 1);
Expand All @@ -908,6 +930,7 @@
} else {
ganttNavigate = $('<div class="navigate" />')
.append($('<button type="button" class="nav-link nav-page-back"/>')
.attr('title', settings.buttons.navPrevPage)
.html('&lt;')
.click(function () {
core.navigatePage(element, -1);
Expand All @@ -916,51 +939,61 @@
.append($('<span/>')
.html(element.pageNum + 1 + ' / ' + element.pageCount)))
.append($('<button type="button" class="nav-link nav-page-next"/>')
.attr('title', settings.buttons.navNextPage)
.html('&gt;')
.click(function () {
core.navigatePage(element, 1);
}))
.append($('<button type="button" class="nav-link nav-begin"/>')
.attr('title', settings.buttons.navBegin)
.html('&#124;&lt;')
.click(function () {
core.navigateTo(element, 'begin');
}))
.append($('<button type="button" class="nav-link nav-prev-week"/>')
.attr('title', settings.buttons.navPrevWeek)
.html('&lt;&lt;')
.click(function () {
core.navigateTo(element, tools.getCellSize() * 7);
}))
.append($('<button type="button" class="nav-link nav-prev-day"/>')
.attr('title', settings.buttons.navPrevDay)
.html('&lt;')
.click(function () {
core.navigateTo(element, tools.getCellSize());
}))
.append($('<button type="button" class="nav-link nav-now"/>')
.attr('title', settings.buttons.navNow)
.html('&#9679;')
.click(function () {
core.navigateTo(element, 'now');
}))
.append($('<button type="button" class="nav-link nav-next-day"/>')
.attr('title', settings.buttons.navNextDay)
.html('&gt;')
.click(function () {
core.navigateTo(element, tools.getCellSize() * -1);
}))
.append($('<button type="button" class="nav-link nav-next-week"/>')
.attr('title', settings.buttons.navNextWeek)
.html('&gt;&gt;')
.click(function () {
core.navigateTo(element, tools.getCellSize() * -7);
}))
.append($('<button type="button" class="nav-link nav-end"/>')
.attr('title', settings.buttons.navEnd)
.html('&gt;&#124;')
.click(function () {
core.navigateTo(element, 'end');
}))
.append($('<button type="button" class="nav-link nav-zoomIn"/>')
.attr('title', settings.buttons.navZoomIn)
.html('&#43;')
.click(function () {
core.zoomInOut(element, -1);
}))
.append($('<button type="button" class="nav-link nav-zoomOut"/>')
.attr('title', settings.buttons.navZoomOut)
.html('&#45;')
.click(function () {
core.zoomInOut(element, 1);
Expand Down