-
14 Dec 2008 6:20 PM #11
Slider is nice to play with the effect. The recent version appears to have changed the drag behavior now, where before it was smooth drag (if the snap was on or off I think) and now it kind of moves on a grid and is a bit choppy.
Hopefully you are saving these in versions. You might want to save your versions as different demos perhaps so people can test the various implementations you have done.
You're still messing around I imagine...looks like high values of the range get some weird behavior where the window binds itself.
I was trying to play with multiple windows as I think the z-index may have an effect here, but I couldn't get far test it with some of the above mentioned problems (not able to turn off snap and reposition windows too easily).
All comments based on viewing with IE7.
Nice work though.
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
-
14 Dec 2008 8:19 PM #12
Nice work David.
-
15 Dec 2008 6:28 PM #13
There's a new version available! http://xant.us/ext-ux/examples/window-edge-snap/
Changelog- v1.1: Added the viewport edges
- v1.2: Rewrote the edge detection algorythm
- v1.3: Increased response time of DropSnap on drag start
- v1.4: Fixed bug where a window would snap to the incorrect area
Last edited by xantus; 15 Dec 2008 at 6:28 PM. Reason: added url
-
16 Dec 2008 11:11 AM #14
v1.6
v1.6
v1.6 is out! It will snap to the nearest window now, instead of the first window it was close enough to snap to.
Also note that I changed the the namespace in the source to match the advertised namespace.
Ext.ux.SnapWindow.DD -> Ext.ux.WindowSnap.DD
-
9 Feb 2009 4:08 AM #15
Hey xantus, could you make use of these overrides I've been working on to enable my MouseProximityFade plugin to help with your proximity detection algorithm?
Pixel geometry is best delegated to the base lib's "Region" class so it doesn't complicate UI code.
Code:Ext.override(Ext.lib.Region, { /** * Returns the shortest distance between this Region and another Region. * Either or both Regions may be Points. * @param {Region} r The other Region * @return {Number} The shortest distance in pixels between the two Regions. */ getDistanceBetween: function(r) { // We may need to mutate r, so make a copy. r = Ext.apply({}, r); // Translate r to the left of this if (r.left > this.right) { var rWidth = r.right - r.left; r.left = this.left - (r.left - this.right) - rWidth; r.right = r.left + rWidth; } // Translate r above this if (r.top > this.bottom) { var rHeight = r.bottom - r.top; r.top = this.top - (r.top - this.bottom) - rHeight; r.bottom = r.top + rHeight; } // If r is directly above if (r.right > this.left) { return this.top - r.bottom; } // If r is directly to the left if (r.bottom > this.top) { return this.left - r.right; } // r is on a diagonal path return Math.round(Math.sqrt(Math.pow(this.top - r.bottom, 2) + Math.pow(this.left - r.right, 2))); } }); Ext.override(Ext.Element, { /** * Returns shortest distance between this Element and the specified point * @param {Number} x The x coordinate. * @param {Number} y The y coordinate. * @return {Number} The shortest distance in pixels between this Element and the specified point. */ getDistanceTo: function(x, y) { return this.getRegion().getDistanceBetween(new Ext.lib.Point(x, y)); }, /** * Returns the shortest distance between this Element and another Element. * @param {Element/DOMElement/String} el The other Element, or its ID. * @return {Number} The shortest distance in pixels between the two Elements. */ getDistanceBetween: function(el) { return this.getRegion().getDistanceBetween(Ext.fly(el).getRegion()); } });Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
9 Feb 2009 1:31 PM #16
-
10 Feb 2009 12:52 AM #17
Very nice widget!Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26
-
10 Feb 2009 1:09 AM #18
The sample http://xant.us/ext-ux/examples/window-edge-snap/ does not appear to work any more. There's no snapping behaviour for me on FF 3.0.6
Search the forum: http://www.google.com/coop/cse?cx=01...%3Az7of1ufqccu
Read the docs too: http://extjs.com/deploy/dev/docs/
Scope: http://extjs.com/forum/showthread.ph...642#post257642
-
10 Feb 2009 12:24 PM #19
-
10 Feb 2009 12:30 PM #20
Working for me FF3.0.6/FB 1.3X.2/Windows XP/
MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow


Reply With Quote

