/* exported UIPMediaLibrary*/
/* global AppSettings, UIProvider, Utils, editor */
/**
 *
 * @param {ProviderData} data
 * @constructor
 */
var UIPMediaLibrary = function (data) {
    'use strict';

    UIPMediaLibrary.superclass.constructor.call(this, data);

    // Frame load
    editor.previewController.setSrc(AppSettings.mediaLibraryUrl);

    // Unsubscribe
    this.dispose = function () {
        var cmsTemplates = window.DataProvider.getInfo().templates;
        var templateName = window.editor.templatesController.currentTemplate.BaseTemplate.templateName;
        editor.previewController.setSrc(cmsTemplates[templateName]);
        UIPMediaLibrary.superclass.dispose.call(this);
        // Frame close
    };
};

Utils.extend(UIPMediaLibrary, UIProvider);