updated dist

This commit is contained in:
vieron
2012-10-07 21:45:06 +02:00
parent 5411836c88
commit a5d122246d
6 changed files with 54 additions and 36 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-10-03 /*! gridster.js - v0.1.0 - 2012-10-07
* http://gridster.net/ * http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */ * Copyright (c) 2012 ducksboard; Licensed MIT */
+24 -15
View File
@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-10-03 /*! gridster.js - v0.1.0 - 2012-10-07
* http://gridster.net/ * http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */ * Copyright (c) 2012 ducksboard; Licensed MIT */
@@ -365,7 +365,8 @@
distance: 1, distance: 1,
limit: true, limit: true,
offset_left: 0, offset_left: 0,
autoscroll: true autoscroll: true,
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON']
// ,drag: function(e){}, // ,drag: function(e){},
// start : function(e, ui){}, // start : function(e, ui){},
// stop : function(e){} // stop : function(e){}
@@ -428,7 +429,7 @@
}; };
fn.events = function() { fn.events = function() {
this.$container.on('selectstart', this.on_select_start); this.$container.on('selectstart', $.proxy(this.on_select_start, this));
this.$container.on(pointer_events.start, this.options.items, $.proxy( this.$container.on(pointer_events.start, this.options.items, $.proxy(
this.drag_handler, this)); this.drag_handler, this));
@@ -535,8 +536,7 @@
return; return;
} }
if (node === 'INPUT' || node === 'TEXTAREA' || node === 'SELECT' || if (this.ignore_drag(e)) {
node === 'BUTTON') {
return; return;
} }
@@ -658,6 +658,11 @@
fn.on_select_start = function(e) { fn.on_select_start = function(e) {
if (this.disabled) { return; } if (this.disabled) { return; }
if (this.ignore_drag(e)) {
return;
}
return false; return false;
}; };
@@ -675,6 +680,10 @@
$.removeData(this.$container, 'drag'); $.removeData(this.$container, 'drag');
}; };
fn.ignore_drag = function(event) {
return $.inArray(event.target.nodeName, this.options.ignore_dragging) >= 0;
};
//jQuery adapter //jQuery adapter
$.fn.drag = function ( options ) { $.fn.drag = function ( options ) {
return this.each(function () { return this.each(function () {
@@ -691,7 +700,7 @@
var defaults = { var defaults = {
namespace: '', namespace: '',
widget_selector: '> li', widget_selector: 'li',
widget_margins: [10, 10], widget_margins: [10, 10],
widget_base_dimensions: [400, 225], widget_base_dimensions: [400, 225],
extra_rows: 0, extra_rows: 0,
@@ -766,7 +775,7 @@
this.options = $.extend(true, defaults, options); this.options = $.extend(true, defaults, options);
this.$el = $(el); this.$el = $(el);
this.$wrapper = this.$el.parent(); this.$wrapper = this.$el.parent();
this.$widgets = $(this.options.widget_selector, this.$el).addClass('gs_w'); this.$widgets = this.$el.children(this.options.widget_selector).addClass('gs_w');
this.widgets = []; this.widgets = [];
this.$changed = $([]); this.$changed = $([]);
this.wrapper_width = this.$wrapper.width(); this.wrapper_width = this.$wrapper.width();
@@ -1983,7 +1992,7 @@
this.move_widget_down( this.move_widget_down(
$w, row + phgd.size_y - $w.data('coords').grid.row); $w, row + phgd.size_y - $w.data('coords').grid.row);
}, this)); }, this));
}; }
}; };
@@ -2064,14 +2073,14 @@
if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) { if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) {
if (!grid_col[r].is(widget_grid_data.el)) { if (!grid_col[r].is(widget_grid_data.el)) {
break; break;
}; }
} }
if (!this.is_player(tcol, r) && if (!this.is_player(tcol, r) &&
!this.is_placeholder_in(tcol, r) && !this.is_placeholder_in(tcol, r) &&
!this.is_player_in(tcol, r)) { !this.is_player_in(tcol, r)) {
upper_rows[tcol].push(r); upper_rows[tcol].push(r);
}; }
if (r < min_row) { if (r < min_row) {
min_row = r; min_row = r;
@@ -2880,7 +2889,7 @@
} }
return $widgets; return $widgets;
} };
/** /**
@@ -3057,8 +3066,8 @@
for (var r = max_rows; r > actual_rows; r--) { for (var r = max_rows; r > actual_rows; r--) {
for (var c = this.cols; c >= 1; c--) { for (var c = this.cols; c >= 1; c--) {
this.add_faux_cell(r, c); this.add_faux_cell(r, c);
}; }
}; }
this.rows = max_rows; this.rows = max_rows;
@@ -3083,8 +3092,8 @@
for (var c = actual_cols; c < max_cols; c++) { for (var c = actual_cols; c < max_cols; c++) {
for (var r = this.rows; r >= 1; r--) { for (var r = this.rows; r >= 1; r--) {
this.add_faux_cell(r, c); this.add_faux_cell(r, c);
}; }
}; }
this.cols = max_cols; this.cols = max_cols;
+1 -1
View File
@@ -1,3 +1,3 @@
/*! gridster.js - v0.1.0 - 2012-10-03 /*! gridster.js - v0.1.0 - 2012-10-07
* http://gridster.net/ * http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important} * Copyright (c) 2012 ducksboard; Licensed MIT */.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s;-moz-transition:opacity .3s,left .3s,top .3s;-o-transition:opacity .3s,left .3s,top .3s;transition:opacity .3s,left .3s,top .3s}.ready .gs_w:not(.preview-holder){-webkit-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-moz-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;-o-transition:opacity .3s,left .3s,top .3s,width .3s,height .3s;transition:opacity .3s,left .3s,top .3s,width .3s,height .3s}.gridster .preview-holder{z-index:1;position:absolute;background-color:#fff;border-color:#fff;opacity:.3}.gridster .player-revert{z-index:10!important;-webkit-transition:left .3s,top .3s!important;-moz-transition:left .3s,top .3s!important;-o-transition:left .3s,top .3s!important;transition:left .3s,top .3s!important}.gridster .dragging{z-index:10!important;-webkit-transition:all 0s!important;-moz-transition:all 0s!important;-o-transition:all 0s!important;transition:all 0s!important}
+2 -2
View File
File diff suppressed because one or more lines are too long
+24 -15
View File
@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-10-03 /*! gridster.js - v0.1.0 - 2012-10-07
* http://gridster.net/ * http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */ * Copyright (c) 2012 ducksboard; Licensed MIT */
@@ -365,7 +365,8 @@
distance: 1, distance: 1,
limit: true, limit: true,
offset_left: 0, offset_left: 0,
autoscroll: true autoscroll: true,
ignore_dragging: ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON']
// ,drag: function(e){}, // ,drag: function(e){},
// start : function(e, ui){}, // start : function(e, ui){},
// stop : function(e){} // stop : function(e){}
@@ -428,7 +429,7 @@
}; };
fn.events = function() { fn.events = function() {
this.$container.on('selectstart', this.on_select_start); this.$container.on('selectstart', $.proxy(this.on_select_start, this));
this.$container.on(pointer_events.start, this.options.items, $.proxy( this.$container.on(pointer_events.start, this.options.items, $.proxy(
this.drag_handler, this)); this.drag_handler, this));
@@ -535,8 +536,7 @@
return; return;
} }
if (node === 'INPUT' || node === 'TEXTAREA' || node === 'SELECT' || if (this.ignore_drag(e)) {
node === 'BUTTON') {
return; return;
} }
@@ -658,6 +658,11 @@
fn.on_select_start = function(e) { fn.on_select_start = function(e) {
if (this.disabled) { return; } if (this.disabled) { return; }
if (this.ignore_drag(e)) {
return;
}
return false; return false;
}; };
@@ -675,6 +680,10 @@
$.removeData(this.$container, 'drag'); $.removeData(this.$container, 'drag');
}; };
fn.ignore_drag = function(event) {
return $.inArray(event.target.nodeName, this.options.ignore_dragging) >= 0;
};
//jQuery adapter //jQuery adapter
$.fn.drag = function ( options ) { $.fn.drag = function ( options ) {
return this.each(function () { return this.each(function () {
@@ -691,7 +700,7 @@
var defaults = { var defaults = {
namespace: '', namespace: '',
widget_selector: '> li', widget_selector: 'li',
widget_margins: [10, 10], widget_margins: [10, 10],
widget_base_dimensions: [400, 225], widget_base_dimensions: [400, 225],
extra_rows: 0, extra_rows: 0,
@@ -766,7 +775,7 @@
this.options = $.extend(true, defaults, options); this.options = $.extend(true, defaults, options);
this.$el = $(el); this.$el = $(el);
this.$wrapper = this.$el.parent(); this.$wrapper = this.$el.parent();
this.$widgets = $(this.options.widget_selector, this.$el).addClass('gs_w'); this.$widgets = this.$el.children(this.options.widget_selector).addClass('gs_w');
this.widgets = []; this.widgets = [];
this.$changed = $([]); this.$changed = $([]);
this.wrapper_width = this.$wrapper.width(); this.wrapper_width = this.$wrapper.width();
@@ -1983,7 +1992,7 @@
this.move_widget_down( this.move_widget_down(
$w, row + phgd.size_y - $w.data('coords').grid.row); $w, row + phgd.size_y - $w.data('coords').grid.row);
}, this)); }, this));
}; }
}; };
@@ -2064,14 +2073,14 @@
if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) { if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) {
if (!grid_col[r].is(widget_grid_data.el)) { if (!grid_col[r].is(widget_grid_data.el)) {
break; break;
}; }
} }
if (!this.is_player(tcol, r) && if (!this.is_player(tcol, r) &&
!this.is_placeholder_in(tcol, r) && !this.is_placeholder_in(tcol, r) &&
!this.is_player_in(tcol, r)) { !this.is_player_in(tcol, r)) {
upper_rows[tcol].push(r); upper_rows[tcol].push(r);
}; }
if (r < min_row) { if (r < min_row) {
min_row = r; min_row = r;
@@ -2880,7 +2889,7 @@
} }
return $widgets; return $widgets;
} };
/** /**
@@ -3057,8 +3066,8 @@
for (var r = max_rows; r > actual_rows; r--) { for (var r = max_rows; r > actual_rows; r--) {
for (var c = this.cols; c >= 1; c--) { for (var c = this.cols; c >= 1; c--) {
this.add_faux_cell(r, c); this.add_faux_cell(r, c);
}; }
}; }
this.rows = max_rows; this.rows = max_rows;
@@ -3083,8 +3092,8 @@
for (var c = actual_cols; c < max_cols; c++) { for (var c = actual_cols; c < max_cols; c++) {
for (var r = this.rows; r >= 1; r--) { for (var r = this.rows; r >= 1; r--) {
this.add_faux_cell(r, c); this.add_faux_cell(r, c);
}; }
}; }
this.cols = max_cols; this.cols = max_cols;
File diff suppressed because one or more lines are too long