jQuery 3.2.1 - use of deprecated size() function in fuel_inline.min.js

rl2rl2
edited October 2017 in Bug Reports
In order to use the latest version of jQuery with Fuel CMS 1.4 it is necessary to update modules/fuel/assets/js/fuel/fuel_inline.min.js on line 78:

var toggleEditOff=true;if(markers.size()>0){$body=$("body");

becomes:

var toggleEditOff=true;if(markers.length>0){$body=$("body");

Comments

  • edited October 2017
    This should be updated in the develop branch.
    https://github.com/daylightstudio/FUEL-CMS/tree/develop
  • rl2rl2
    edited January 2018
    Okay back to this one, I can see you have updated the branch to the latest jQuery, however not sure you tested in with the latest query as this alone does not fix the problem entirely - another error simply appears in the console. Interesting the same error appears if I select Page Analysis from the Tools drop-down in the fuel_edit_bar.

    Click a pencil to edit inline element, this appears really quickly before going to a blank page.

    jquery.min.js:4 Uncaught TypeError: a.indexOf is not a function
    at e.fn.init.r.fn.load (jquery.min.js:4)
    at Object.fuel.modalWindow (fuel_inline.min.js?c=:75)
    at HTMLSelectElement. (fuel_inline.min.js?c=:91)
    at HTMLSelectElement.dispatch (jquery.min.js:3)
    at HTMLSelectElement.q.handle (jquery.min.js:3)
    r.fn.load @ jquery.min.js:4
    fuel.modalWindow @ fuel_inline.min.js?c=:75
    (anonymous) @ fuel_inline.min.js?c=:91
    dispatch @ jquery.min.js:3
    q.handle @ jquery.min.js:3

    Blank page: This variable must either be saved in the admin or edited in the associated views/_variables file.

    But like I've said previously the variable definitely does exist - its failing on that all important piece of jQuery.

    Tools->Page Analysis:

    Same output - except for 88 instead of 91.

    jquery.min.js:4 Uncaught TypeError: a.indexOf is not a function
    at e.fn.init.r.fn.load (jquery.min.js:4)
    at Object.fuel.modalWindow (fuel_inline.min.js?c=:75)
    at HTMLSelectElement. (fuel_inline.min.js?c=:88)
    at HTMLSelectElement.dispatch (jquery.min.js:3)
    at HTMLSelectElement.q.handle (jquery.min.js:3)
    r.fn.load @ jquery.min.js:4
    fuel.modalWindow @ fuel_inline.min.js?c=:75
    (anonymous) @ fuel_inline.min.js?c=:91
    dispatch @ jquery.min.js:3
    q.handle @ jquery.min.js:3

    ---

    Not sure how to fix this one myself.

    PS. Whenever I finish this website I sure to send you a link for your showcase!
  • edited 7:36AM
    I was able to replicate the issue and pushed a fix to the develop branch.
  • rl2rl2
    edited January 2018
    Getting there, Page Analysis is now working, however inline editing still not working, the below still appears.

    jquery.min.js:4 Uncaught TypeError: a.indexOf is not a function
    at e.fn.init.r.fn.load (jquery.min.js:4)
    at HTMLAnchorElement. (fuel_inline.min.js?c=:1781)
    at HTMLAnchorElement.dispatch (jquery.min.js:3)
    at HTMLAnchorElement.q.handle (jquery.min.js:3)
    r.fn.load @ jquery.min.js:4
    (anonymous) @ fuel_inline.min.js?c=:1781
    dispatch @ jquery.min.js:3
    q.handle @ jquery.min.js:3

    BTW, the files haven't been minified.
  • edited 7:36AM
    Hmm... inline editing seems to be working for me. Did you try clearing your cache? Also, the files are essentially concatenated and general whitespace is reduced. Is that not what you are seeing?
  • rl2rl2
    edited 7:36AM
    Yes tried clearly the cache just now, same error as above.

    They appear to be minified aside from line breaks.
  • edited January 2018
    I see the error now and have pushed a fix to the develop branch.
  • rl2rl2
    edited 7:36AM
    Fuel and Browser cache cleared, 3 files replaced, same error.

    jquery.min.js:4 Uncaught TypeError: a.indexOf is not a function
    at e.fn.init.r.fn.load (jquery.min.js:4)
    at HTMLAnchorElement. (fuel_inline.min.js?c=:1781)
    at HTMLAnchorElement.dispatch (jquery.min.js:3)
    at HTMLAnchorElement.q.handle (jquery.min.js:3)
    r.fn.load @ jquery.min.js:4
    (anonymous) @ fuel_inline.min.js?c=:1781
    dispatch @ jquery.min.js:3
    q.handle @ jquery.min.js:3
  • edited 7:36AM
    Looks like there was another spot. Try now.
  • rl2rl2
    edited 7:36AM
    Excellent, I can confirm it now works.

    Just one thing now, if the modal contains a textarea the width isn't wide enough - I do however get a horizontal scrollbar. Hopefully something a little CSS will easily fix.
  • rl2rl2
    edited 7:36AM
    One thing I have noticed now is when inline editing is enabled is the speed has drastically fallen with a lot of 'blocking' occurring and seemingly high cpu usage. The drop-down menu is especially difficult to use with this enabled. I will be encouraging our content team to use this mode sparingly if this is not addressed.
  • edited 7:36AM
    How many pencil icons (inline editing variables) do you have on the page? It can become a bit but much when there are a lot of them because there are resize listeners that are firing to adjust the pencil positions.
  • rl2rl2
    edited January 2018
    front page alone has 18 inline edits.

    6 on another
    18 on another
    I have an A-Z glossary page that has a link per letter, will have to turn that off for sure.

    I'll just have to be more selective.
Sign In or Register to comment.