Jump to content
Search Community

martinambrus

Members
  • Posts

    8
  • Joined

  • Last visited

Recent Profile Visitors

1,998 profile views

martinambrus's Achievements

  1. Thanks Jack, I've tried the new Draggable version and it seems that it fixes the ability to click inside the contenteditable areas and start editing. However, the moment I stop typing on a keyboard, the editable area seems to loose focus, which will disable editing the content altogether until I click inside again. This is the behaviour that has driven me to write this bug report, so the updated version basically solves the ability to click inside a contenteditable but won't allow me to continuously edit that content if I stop typing or move my mouse out of the area.
  2. Eventually, it would be great if this could be addressed inside Draggable, as I've already came across a use case where a person clicks inside the contenteditable area and moves their mouse away, thus bringing the issue back. The only way I can work around this now is by creating an "edit" mode which disables all draggables on page, so elements are editable there. This works but needs an additional switch/click added to the workflow, and we're very much trying to avoid such a need Thanks!
  3. Thanks Diaco.AW ... this solves it for me on Desktop and with some modifications on touch devices as well, I guess. Should this not be kept here and reported as a bug then? Do I mark this as solved?
  4. I've just discovered that Draggable will clash with contenteditable="true" elements in a way that: it sometimes puts edit cursor at the beginning of the editable element most of the time it prevents editable content to be edited, except when it contains clickable elements, like A, INPUT, BUTTON... Example: http://jsfiddle.net/9j2r56md/ ... in the example, there are 2 boxes, both enhanced via Froala Editor which basically just adds a DIV with contenteditable="true". First div has data-clickable="true" on the draggable container DIV, so the DIV is not draggable but the issue is still visible. The second one has an additional strange behaviour, as it starts to drag the box when the contenteditable="true" element is clicked. An updated version is available here that just adds one extra DIV with contenteditable="true" only, so it's obvious that it's not a Froala thing: http://jsfiddle.net/9j2r56md/1/
  5. I've actually found a nice jQuery plugin that enables auto-scroll for droppables: https://groups.google.com/forum/#!searchin/threedubmedia/autoscroll/threedubmedia/Ffues0BsuN8/s9syU7PGgUUJ I believe the code from it can be extracted and updated for use outside of jQuery as well, so I will post it here for reference (in case the link stops working): jQuery.fn.autoScroll = function( arg, opts ){ opts = opts || {}; // the main element var elem = this[0], // the coordinates to calculate XX = arg.pageX || arg.left || arg[0] || 0, YY = arg.pageY || arg.top || arg[1] || 0, // the optional options... buffer = opts.buffer || 100, // pixels from edge dist = opts.distance || 20, // pixels to scroll per call // page/document scrolling... page = !elem.ownerDocument || jQuery.nodeName(elem,'html'), // the element to utilize $elem = page ? jQuery( window ) : this.eq(0), // the parameters to modify... top = $elem.scrollTop(), left = $elem.scrollLeft(), // attributes to calculate position offset = page ? { top:0, left:0 } : $elem.offset(), // calculate buffer zones south = YY - offset.top - ( page ? top : 0 ), north = $elem.height() + offset.top - YY - ( page ? top : 0 ), east = XX - offset.left - ( page ? left : 0 ), west = $elem.width() + offset.left - XX - ( page ? left : 0 ), // calculate the distance to move... vert = south < buffer ? -dist : north < buffer ? dist : 0, hori = east < buffer ? -dist : west < buffer ? dist : 0; // set the vertical scroll if ( vert != 0 ) $elem.scrollTop( top + vert ); // set the horizontal scroll if ( hori != 0 ) $elem.scrollLeft( left + hori ); // preserve jquery chain... return this; }; $( window ).autoScroll( event ); Thanks for the pointer though, Jack
  6. Is there a possibility to drag the window as I drag elements around in a window? I mean, if the window is higher than what the browser can currently display, I need to scroll it down to reveal the rest of the page. I have encountered questions about scrolling a container for the actual Draggable element itself, which is not what I'm after - I simply need to scroll the whole window/document, as I'm not limiting the drag to a container. Thanks for any pointers you could give me here
  7. Hi guys, just been testing cross-browser compatibility of Draggable via its demo page (http://greensock.com/draggable) and found out that it does not run on MSIE8 under WIndows 7 (in a Virtual Machine downloaded from https://www.modern.ie/en-us/virtualization-tools). It gives out the classic "Object does not support this property or method" and Codepen obviously won't work in MSIE8 at all, so I can't test it there. I know that this whole thing should be compatible with MSIE7+ from what I read, so I'm a bit confused now. Any advice please? Thanks, Martin
×
×
  • Create New...