Skip to content

Commit

Permalink
Merge pull request Knockout-Contrib#189 from igoryan-k/master
Browse files Browse the repository at this point in the history
fix column drag and drop for IE9 and IE10
  • Loading branch information
jonricaurte committed Jan 19, 2013
2 parents 3f65ee3 + edf3776 commit a61731b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
11 changes: 8 additions & 3 deletions build/KoGrid.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/19/2012 10:15:47
* Compiled At: 01/11/2013 15:58:36
***********************************************/

(function (window) {
Expand Down Expand Up @@ -659,6 +659,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down Expand Up @@ -1891,7 +1896,7 @@ window.kg.StyleProvider = function (grid) {
};

/***********************************************
* FILE: ..\src\classes\SortService.js
* FILE: ..\src\classes\sortService.js
***********************************************/
window.kg.sortService = {
colSortFnCache: {}, // cache of sorting functions. Once we create them, we don't want to keep re-doing it
Expand Down Expand Up @@ -2144,7 +2149,7 @@ window.kg.sortService = {
};

/***********************************************
* FILE: ..\src\classes\DomUtilityService.js
* FILE: ..\src\classes\domUtilityService.js
***********************************************/
var getWidths = function () {
var $testContainer = $('<div></div>');
Expand Down
11 changes: 8 additions & 3 deletions koGrid-2.1.1.debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* koGrid JavaScript Library
* Authors: https://github.com/ericmbarnard/koGrid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 12/19/2012 10:15:47
* Compiled At: 01/11/2013 15:58:36
***********************************************/

(function (window) {
Expand Down Expand Up @@ -659,6 +659,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down Expand Up @@ -1891,7 +1896,7 @@ window.kg.StyleProvider = function (grid) {
};

/***********************************************
* FILE: ..\src\classes\SortService.js
* FILE: ..\src\classes\sortService.js
***********************************************/
window.kg.sortService = {
colSortFnCache: {}, // cache of sorting functions. Once we create them, we don't want to keep re-doing it
Expand Down Expand Up @@ -2144,7 +2149,7 @@ window.kg.sortService = {
};

/***********************************************
* FILE: ..\src\classes\DomUtilityService.js
* FILE: ..\src\classes\domUtilityService.js
***********************************************/
var getWidths = function () {
var $testContainer = $('<div></div>');
Expand Down
2 changes: 1 addition & 1 deletion koGrid-2.1.1.js

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

5 changes: 5 additions & 0 deletions src/classes/eventProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ window.kg.EventProvider = function (grid) {
self.setDraggables = function(){
if(!grid.config.jqueryUIDraggable){
grid.$root.find('.kgHeaderSortColumn').attr('draggable', 'true');
if (navigator.userAgent.indexOf("MSIE") != -1)
{
//call native IE dragDrop() to start dragging
grid.$root.find('.kgHeaderSortColumn').bind('selectstart', function () { this.dragDrop(); return false; });
}
} else {
grid.$root.find('.kgHeaderSortColumn').draggable({
helper: 'clone',
Expand Down

0 comments on commit a61731b

Please sign in to comment.