ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

SafeCracker File JS doesn't run if safecracker_head="no"

May 22, 2012 4:46am

Subscribe [1]
  • #1 / May 22, 2012 4:46am

    Dane Thomas

    139 posts

    Just want someone else to confirm this - not sure if it’s a bug or a ‘feature’.

    I’m using SafeCracker via a AJAX form and I’m getting a decent amount of JS slowing down the page. The JS in question in this request

    ?ACT=27&ui=core,widget,mouse,position,draggable,resizable,button,dialog&plugin=scrollable,scrollable.navigator,ee_filebrowser,ee_fileuploader,markitup,thickbox,toolbox.expose,overlay,tmpl&v=1331941604&_=1337675962658

    Now I’m not using any datepickers so I’ve tried to use safecracker_head=“no”

    This dramatically speeds up the page and things seems to be fine, however I am using the SafeCracker File in a couple of areas.

    It seems that the click handler for the .safecracker_file_remove_button and the .safecracker_file_undo_button isn’t run.

    This JS is part of SafeCracker files add_js() method and uses $this->EE->javascript->output();

    My question is, when using safecracker_head=“no” should this SafeCracker File JS still run?

  • #2 / May 22, 2012 10:48am

    Bhashkar Yadav

    727 posts

    Hi Dane,

    If you are not using datepicker then use datepicker=“no”. While using safecraker file you should use safecracker_head=“yes” which prepare file related stuff and few other things.


    Best Regards,

  • #3 / May 22, 2012 9:29pm

    Dane Thomas

    139 posts

    If the recommendation for using Safe Cracker File is to use safecracker_head=“no” then there appears to be a bug.

    With this setting, upload a file and save it.

    Edit this form and try to remove the file, there is no clicker handler for that action.

    The JS required for this is in the add_js() method of SF File field type but it’s never sent or executed.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases