Skip to content

Commit

Permalink
fixed wheel handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey authored and Sergey committed Oct 20, 2014
1 parent 3f19eac commit 224a5fa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/jcf.scrollable.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
}

// prevent default action and scroll item
if(preventFlag) {
if(preventFlag || this.options.alwaysPreventMouseWheel) {
e.preventDefault();
} else {
return;
Expand Down Expand Up @@ -191,21 +191,21 @@
desiredDimensions = {
width: this.realElement.innerWidth() + this.vBar.getThickness(),
height: this.realElement.innerHeight() + this.hBar.getThickness()
}
};
} else {
// unwrap real element and measure it according to CSS
this.saveElementDimensions().saveScrollOffsets();
this.realElement.insertAfter(this.scrollWrapper);
this.scrollWrapper.detach();

// measure element
currentStyles = this.realElement.prop('style'),
currentWidth = parseFloat(currentStyles.width),
currentStyles = this.realElement.prop('style');
currentWidth = parseFloat(currentStyles.width);
currentHeight = parseFloat(currentStyles.height);

// reset styles if needed
if(this.embeddedDimensions && currentWidth && currentHeight) {
this.isModifiedStyles |= (currentWidth !== this.embeddedDimensions.width || currentHeight !== this.embeddedDimensions.height)
this.isModifiedStyles |= (currentWidth !== this.embeddedDimensions.width || currentHeight !== this.embeddedDimensions.height);
this.realElement.css({
overflow: '',
width: '',
Expand Down

0 comments on commit 224a5fa

Please sign in to comment.