I need to override a paritcular javascript variable within Foundation 3.2.5 library. I need to do it in such a way I do not include the entire project just for this change.
The variable I am willing to override is in this particular file jquery.foundation.clearing.js
Snippet:
;(function ($, window, document, undefined) {
'use strict';
var defaults = {
templates : {
viewing : '<a href="#" class="clearing-close">×</a>' +
'<div class="visible-img" style="display: none"><img src="#">' +
'<p class="clearing-caption"></p><a href="#" class="clearing-main-left"></a>' +
'<a href="#" class="clearing-main-right"></a></div>'
},
close_selectors : 'a.clearing-close',
initialized : false,
locked : false
},
The full file is located here
The variable I want to override is defaults.templates.viewing
. How to accomplish this smartly in Rails with minimal code change? I tried to create a foundaiton_override.js file but I don't know how to access the specific variable directly from there and override it.