Skip to content

Commit

Permalink
v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Lakenen committed Sep 2, 2014
1 parent 4ac7195 commit f9e87fe
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Viewer.js uses [semantic versioning](http://semver.org/) for its version numbers.

* **0.7.0**
* Add `.crocodoc-preceding-page` class for easier transition effects in presentation layout
* **0.6.1**
* Simplify and add comments to the presentation transition examples
* Fix [#125](https://github.com/box/viewer.js/issues/125) - Pages are shifted right in IE 7
Expand Down Expand Up @@ -31,7 +33,7 @@ Viewer.js uses [semantic versioning](http://semver.org/) for its version numbers
* Fix [#70](https://github.com/box/viewer.js/issues/70) - IE 11 crashes when unloading pages
* **0.5.3**
* Fix IE9 issue with box-sizing: initial
* LazyLader: only load visible pages initially to improve initial load performance
* LazyLoader: only load visible pages initially to improve initial load performance
* **0.5.2**
* Fix issue with optimistic asset prefetching in non-svg browsers (e.g., IE 8)
* **0.5.1**
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viewer",
"version": "0.6.1",
"version": "0.7.0",
"homepage": "https://github.com/box/viewer.js",
"authors": [
"Cameron Lakenen <lakenen@box.com>",
Expand Down
2 changes: 1 addition & 1 deletion dist/crocodoc.viewer.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Crocodoc Viewer - v0.6.1 | (c) 2014 Box */
/*! Crocodoc Viewer - v0.7.0 | (c) 2014 Box */

.crocodoc-viewer {
padding:0;
Expand Down
24 changes: 20 additions & 4 deletions dist/crocodoc.viewer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Crocodoc Viewer - v0.6.1 | (c) 2014 Box */
/*! Crocodoc Viewer - v0.7.0 | (c) 2014 Box */

(function (window) {
/*global jQuery*/
Expand Down Expand Up @@ -3565,6 +3565,7 @@ Crocodoc.addComponent('layout-' + Crocodoc.LAYOUT_PRESENTATION, ['layout-base'],
CSS_CLASS_PAGE_BEFORE_BUFFER = CSS_CLASS_PAGE_PREFIX + 'before-buffer',
CSS_CLASS_PAGE_AFTER_BUFFER = CSS_CLASS_PAGE_PREFIX + 'after-buffer',
CSS_CLASS_CURRENT_PAGE = 'crocodoc-current-page',
CSS_CLASS_PRECEDING_PAGE = 'crocodoc-preceding-page',
PRESENTATION_CSS_CLASSES = [
CSS_CLASS_PAGE_NEXT,
CSS_CLASS_PAGE_AFTER,
Expand Down Expand Up @@ -3659,11 +3660,26 @@ Crocodoc.addComponent('layout-' + Crocodoc.LAYOUT_PRESENTATION, ['layout-base'],
* @param {int} page The page number
*/
setCurrentPage: function (page) {
var index = util.clamp(page - 1, 0, this.numPages);
var index = util.clamp(page - 1, 0, this.numPages),
$precedingPage,
$currentPage;

base.setCurrentPage.call(this, page);

// update CSS classes
this.$doc.find('.' + CSS_CLASS_CURRENT_PAGE).removeClass(CSS_CLASS_CURRENT_PAGE);
this.$pages.eq(this.state.currentPage - 1).addClass(CSS_CLASS_CURRENT_PAGE);
this.$doc.find('.' + CSS_CLASS_PRECEDING_PAGE)
.removeClass(CSS_CLASS_PRECEDING_PAGE);

$precedingPage = this.$doc.find('.' + CSS_CLASS_CURRENT_PAGE);
$currentPage = this.$pages.eq(index);

if ($precedingPage[0] !== $currentPage[0]) {
$precedingPage
.addClass(CSS_CLASS_PRECEDING_PAGE)
.removeClass(CSS_CLASS_CURRENT_PAGE);
$currentPage.addClass(CSS_CLASS_CURRENT_PAGE);
}

this.updateVisiblePages(true);
this.updatePageClasses(index);
},
Expand Down
2 changes: 1 addition & 1 deletion dist/crocodoc.viewer.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/crocodoc.viewer.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "viewer",
"version": "0.6.1",
"version": "0.7.0",
"description": "A viewer for documents converted with the Box View API",
"author": "Cameron Lakenen <lakenen@box.com>",
"contributors": [
Expand Down

0 comments on commit f9e87fe

Please sign in to comment.