Skip to content

Commit 629758c

Browse files
author
eMazeika
committed
platform - custom mousewheel disabled
Former-commit-id: 943fea1d3c6850a4c3e314787b42616958593eb6
1 parent 3b088b5 commit 629758c

File tree

1 file changed

+1
-61
lines changed

1 file changed

+1
-61
lines changed

PLATFORM/VirtoCommerce.Platform.Web/Scripts/app/navigation/blade/bladeNavigation.js

+1-61
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ angular.module('platformWebApp')
5353
element.removeAttr("va-blade");
5454
$compile(element)(scope);
5555

56-
var speed = (window.navigator.platform == 'MacIntel' ? .5 : 40);
57-
5856
var mainContent = $('.cnt');
5957
var blade = $(element).parent('.blade');
6058
var offset = parseInt(blade.offset().left + mainContent.scrollLeft() + blade.width() + 125 - mainContent[0].clientWidth);
@@ -70,69 +68,11 @@ angular.module('platformWebApp')
7068
}
7169

7270
$timeout(function () {
73-
7471
if (offset > mainContent.scrollLeft()) {
7572
mainContent.animate({ scrollLeft: offset + 'px' }, 500);
7673
}
77-
78-
7974
}, 0, false);
8075

81-
82-
//Somehow vertical scrollbar does not work initially so need to turn it on
83-
// $(element).find('.blade-content').off('mousewheel').on('mousewheel', function (event, delta)
84-
// {
85-
// this.scrollTop -= (delta * speed);
86-
// event.preventDefault();
87-
// });
88-
89-
$(element).find('.blade-container').on('mouseenter', function (e) {
90-
var blade = $(this),
91-
bladeI = blade.find('.blade-inner'),
92-
bladeH = bladeI.height(),
93-
bladeIh = blade.find('.inner-block').height() + 5;
94-
95-
if (blade.length) {
96-
if (bladeH <= bladeIh) {
97-
horizontalScroll('off');
98-
}
99-
else {
100-
horizontalScroll('on');
101-
}
102-
}
103-
}).on('mouseleave', function () {
104-
horizontalScroll('on');
105-
});
106-
107-
$('.dashboard-area').on('mouseenter', function (event) {
108-
var dashboardA = $(this),
109-
dashboardH = dashboardA.height(),
110-
dashboardIh = dashboardA.find('.dashboard-inner').height();
111-
112-
if (dashboardA.length) {
113-
if (dashboardH <= dashboardIh) {
114-
horizontalScroll('off');
115-
}
116-
else {
117-
horizontalScroll('on');
118-
}
119-
}
120-
}).on('mouseleave', function () {
121-
horizontalScroll('on');
122-
});
123-
124-
function horizontalScroll(flag) {
125-
if (flag != 'off') {
126-
$('.cnt').off('mousewheel').on('mousewheel', function (event, delta) {
127-
this.scrollLeft -= (delta * speed);
128-
event.preventDefault();
129-
});
130-
}
131-
else {
132-
$('.cnt').unmousewheel();
133-
}
134-
}
135-
13676
scope.bladeMaximize = function () {
13777
scope.maximized = true;
13878

@@ -262,7 +202,7 @@ angular.module('platformWebApp')
262202
//Show blade as last one by default
263203
blade.xindex = service.stateBlades().length;
264204
}
265-
205+
266206
var showBlade = function () {
267207
if (angular.isDefined(parentBlade)) {
268208
blade.xindex = service.stateBlades().indexOf(parentBlade) + 1;

0 commit comments

Comments
 (0)