Skip to content

Insert code

To replace the default widget files, use the insert code method applyWidgetsOptions.

var widgetsOptions = {/*...*/};
__cs.push(['applyWidgetsOptions', widgetsOptions]);

An argument of the method is an object that describes the url-address for widget components depending on the type of the device.

The object has the form:

var widgetsOptions = {
   'personal_form': {
       desktop: {
           js: '//callgear.com/personal_form.js',
           css: '//callgear.com/personal_form_desktop.css',
           tpls: {
               "personal_form": '//callgear.com/personal_form.html'
           }
       }
   }/*,
   ...
   */
};

This object is divided on the first level by viewcontrollers names, on the second by the type of device (desktop, tablet, mobile).