Skip to content

Commit

Permalink
Updated jQuery plugin to version 1.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi committed Apr 23, 2015
1 parent 0fc593b commit e8c9c01
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions assets/css/rocksolid-slider.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
cursor: -ms-grabbing;
cursor: -o-grabbing;
cursor: grabbing;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

@media print {
Expand Down
2 changes: 1 addition & 1 deletion assets/css/rocksolid-slider.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 17 additions & 4 deletions assets/js/rocksolid-slider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! rocksolid-slider v1.5.1 */
/*! rocksolid-slider v1.5.2 */
(function($, window, document) {

var Rst = {};
Expand Down Expand Up @@ -2387,7 +2387,11 @@ Rst.Slider = (function() {
&& $.inArray(slideIndex, this.getActiveSlides()) === -1
&& !this.normalizeSize
) {
// Don't resize if the source slide doesn't affect the size
this.getSlide(slideIndex).size(
this.options.direction === 'x' ? this.slideSize : this.rowSize,
this.options.direction !== 'x' ? this.slideSize : this.rowSize
);
// Don't resize the whole slider if the source slide doesn't affect the size
return;
}

Expand Down Expand Up @@ -2747,9 +2751,8 @@ Rst.Slider = (function() {

var pos = this.getPositionFromEvent(event);

this.elements.main.addClass(this.options.cssPrefix + 'dragging');

this.isDragging = true;
this.isDraggingStarted = false;
this.dragStartPos = {
x: pos.x - this.elements.slides.offset().left + this.elements.crop.offset().left,
y: pos.y - this.elements.slides.offset().top + this.elements.crop.offset().top
Expand Down Expand Up @@ -2778,6 +2781,7 @@ Rst.Slider = (function() {
}

this.isDragging = false;
this.isDraggingStarted = false;
this.elements.main.removeClass(this.options.cssPrefix + 'dragging');

if (this.dragLastDiff === 0 || this.dragLastDiff === undefined) {
Expand Down Expand Up @@ -2848,6 +2852,15 @@ Rst.Slider = (function() {
return this.onDragStop();
}

if (!this.isDraggingStarted) {
this.isDraggingStarted = true;
this.elements.main.addClass(this.options.cssPrefix + 'dragging');
(function() {
var selection = (window.getSelection && window.getSelection()) || document.selection || {};
(selection.empty || selection.removeAllRanges || function() {}).apply(selection);
})();
}

var posDiff = this.dragLastPos - pos[this.options.direction];
var slidesPos =
pos[this.options.direction] -
Expand Down
4 changes: 2 additions & 2 deletions assets/js/rocksolid-slider.min.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions assets/sass/rocksolid-slider.sass
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
.rsts-thumbs-type-slide.rsts-thumbs-dragging .rsts-thumbs-view
cursor: url("../img/closedhand.cur"), default
+experimental-value(cursor, grabbing)
-webkit-user-select: none
-moz-user-select: none
-ms-user-select: none
user-select: none

@media print
.rsts-nav,
Expand Down

0 comments on commit e8c9c01

Please sign in to comment.