We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Inconsistent Element object in FluidField.on

Developer Preview

Reinos's avatar
Reinos
79 posts
7 years ago
Reinos's avatar Reinos

I just notice that in the event FluidField.on('field_type', 'add') the element is a jQuery object and in the other events a DOM element.

I would be better to make it or a jQuery object or a DOM element, but not mixed… I suggest a jQuery object 😊

       
Seth Barber's avatar
Seth Barber
172 posts
7 years ago
Seth Barber's avatar Seth Barber

I’m looking at the code and every FluidField triggered event should be passing a jQuery object. I’m not seeing a mismatch anywhere. Can you elaborate on what you are seeing?

       
Reinos's avatar
Reinos
79 posts
7 years ago
Reinos's avatar Reinos

Hi Seth,

I console.log the element in the events: https://www.dropbox.com/s/ytc7lis1pbe1ab2/fluid.png?dl=0

Doing a .find() on a element; add succeed and the rest failed Uncaught TypeError: element.find is not a function

       
Seth Barber's avatar
Seth Barber
172 posts
7 years ago
Seth Barber's avatar Seth Barber

Ah. It looks like the sorting events are not returning jQuery objects. On line 72 and 82 of themes/ee/asset/javascript/src/fields/fluid_field/cp.js can you change them to be FluidField.fireEvent($(ui.item).data('field-type'), 'beforeSort', $(ui.item)) and FluidField.fireEvent($(ui.item).data('field-type'), 'afterSort', $(ui.item)) respectively and let me know if that resolves it for you?

       
Reinos's avatar
Reinos
79 posts
7 years ago
Reinos's avatar Reinos

Yes thanks!

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.