Enqueue custom scripts when modal loads

How do I load a custom third party script when the model loads? I see that I can add something like the following:

public function enqueue_scripts()
	{
		if ( $this->settings && $this->settings->link_type == 'lightbox' ) {
			$this->add_js('nb_expose_js', $this->url . 'js/jquery.expose.js', array(), '', true);
		}
	}

However, this will not load unless the modal is saved as $this->settings is NULL when the modal loads.

I found the solution, but here is the answer in the event others need it. Add the following in your module class. Keep in mind I would use the setting.js with the help of FLBuilder.registerModuleHelper() and its functions before using this method when possible. settings.js is good for smaller validations and snippets. The below method is good for third party scripts or css files.

function enqueue_scripts(){
		if(class_exists('FLBuilderModel') && FLBuilderModel::is_builder_active()){
			//jquery expose for highlighting section of the widgets to edit
			$this->add_js('custom_js', $this->url . 'js/custom.js', array(), '', 
			$this->add_css('custom_css', $this->url . 'css/custom.css', array(), '', true);
		}
	}