[REF] website, *: move and review the notion of edit mode

* portal, sale, web, website_blog, website_crm_partner_assign,
  website_forum, website_event_track, website_links, website_mail,
  website_slides, website_mail_channel, website_mass_mailing,
  website_sale, website_sale_comparison, website_sale_delivery,
  website_sale_wishlist

The `editableMode` option and its related options in public widget
should only be part of website, this commit moves them there. This is
also the occasion to implement something that is long overdue: stop
creating 'animations' / public widgets in edit mode by default. Indeed,
lots of 'animations' were defined by beginning with 'if not edit mode'.
Now, if a public widget should be considered in edit mode, it must be
defined explicitely through a property at *definition* of the widget.

Part of https://github.com/odoo/odoo/pull/29442
task-1932066
This commit is contained in:
qsm-odoo
2019-02-26 17:09:22 +00:00
parent 27fca749af
commit 335a505d1f
33 changed files with 118 additions and 116 deletions
+2 -10
View File
@@ -5,7 +5,7 @@ var publicWidget = require('web.public.widget');
publicWidget.registry.portalDetails = publicWidget.Widget.extend({
selector: '.o_portal_details',
read_events: {
events: {
'change select[name="country_id"]': '_onCountryChange',
},
@@ -14,9 +14,6 @@ publicWidget.registry.portalDetails = publicWidget.Widget.extend({
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return;
}
this.$state = this.$('select[name="state_id"]');
this.$stateOptions = this.$state.filter(':enabled').find('option:not(:first)');
@@ -55,7 +52,7 @@ publicWidget.registry.portalDetails = publicWidget.Widget.extend({
publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
selector: '.o_portal_search_panel',
read_events: {
events: {
'click .search-submit': '_onSearchSubmitClick',
'click .dropdown-item': '_onDropdownItemClick',
'keyup input[name="search"]': '_onSearchInputKeyup',
@@ -66,12 +63,7 @@ publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return;
}
this._adaptSearchLabel(this.$('.dropdown-item.active'));
return def;
},
@@ -4,7 +4,7 @@ odoo.define('sale.ProductConfiguratorFormRenderer', function (require) {
var FormRenderer = require('web.FormRenderer');
var ProductConfiguratorMixin = require('sale.ProductConfiguratorMixin');
var ProductConfiguratorFormRenderer = FormRenderer.extend(ProductConfiguratorMixin ,{
var ProductConfiguratorFormRenderer = FormRenderer.extend(ProductConfiguratorMixin, {
/**
* @override
*/
@@ -135,6 +135,14 @@ var PublicRoot = publicWidget.RootWidget.extend(ServiceProviderMixin, {
_getExtraContext: function (context) {
return this._getContext(context);
},
/**
* @private
* @param {Object} [options]
* @returns {Object}
*/
_getPublicWidgetsRegistry: function (options) {
return publicWidget.registry;
},
/**
* As the root instance is designed to be unique, the associated
* registry has been instantiated outside of the class and is simply
@@ -176,7 +184,7 @@ var PublicRoot = publicWidget.RootWidget.extend(ServiceProviderMixin, {
this._stopAnimations($from);
var defs = _.map(publicWidget.registry, function (WebsiteWidget) {
var defs = _.map(this._getPublicWidgetsRegistry(options), function (WebsiteWidget) {
var selector = WebsiteWidget.prototype.selector || '';
var $target = $from.find(selector).addBack(selector);
@@ -207,41 +207,15 @@ var PublicWidget = Widget.extend({
* @type {Object}
*/
events: {},
/**
* Acts as @see Widget.events except that the events are only binded if the
* Animation instance is instanciated in edit mode.
*/
edit_events: {},
/**
* Acts as @see Widget.events except that the events are only binded if the
* Animation instance is instanciated in readonly mode.
*/
read_events: {},
/**
* Initializes the events that will need to be binded according to the
* given mode.
*
* @constructor
* @param {Object} parent
* @param {Object} options
* @param {boolean} options.editableMode - true if the page is in edition mode
* @param {Object} [options]
*/
init: function (parent, options) {
this._super.apply(this, arguments);
// Note that the notion of editable mode is kept here for now even
// though nothing can be edited here. This allows to have a readable
// code for frontend widgets and mainly to prevent having loading
// problems an "include" could have caused.
this.options = options || {};
this.editableMode = this.options.editableMode || false;
if (this.editableMode) {
this.events = _.extend({}, this.events || {}, this.edit_events || {});
} else {
this.events = _.extend({}, this.events || {}, this.read_events || {});
}
},
/**
* Destroys the animation and basically restores the target to the state it
@@ -13,9 +13,6 @@ sAnimation.registry.affixMenu = sAnimation.Class.extend({
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
var self = this;
this.$headerClone = this.$target.clone().addClass('o_header_affix affix').removeClass('o_affix_enabled');
@@ -33,6 +33,54 @@ if (!window.performance || !window.performance.now) {
};
}
/**
* Add the notion of edit mode to public widgets.
*/
publicWidget.Widget.include({
/**
* Indicates if the widget should not be instantiated in edit. The default
* is true, indeed most (all?) defined widgets only want to initialize
* events and states which should not be active in edit mode (this is
* especially true for non-website widgets).
*
* @type {boolean}
*/
disabledInEditableMode: true,
/**
* Acts as @see Widget.events except that the events are only binded if the
* Animation instance is instanciated in edit mode. The property is not
* considered if @see disabledInEditableMode is false.
*/
edit_events: null,
/**
* Acts as @see Widget.events except that the events are only binded if the
* Animation instance is instanciated in readonly mode. The property only
* makes sense if @see disabledInEditableMode is false, you should simply
* use @see Widget.events otherwise.
*/
read_events: null,
/**
* Initializes the events that will need to be binded according to the
* given mode.
*
* @constructor
* @param {Object} parent
* @param {Object} [options]
* @param {boolean} [options.editableMode=false]
* true if the page is in edition mode
*/
init: function (parent, options) {
this._super.apply(this, arguments);
this.editableMode = this.options.editableMode || false;
var extraEvents = this.editableMode ? this.edit_events : this.read_events;
if (extraEvents) {
this.events = _.extend(this.events || {}, extraEvents);
}
},
});
/**
* In charge of handling one animation loop using the requestAnimationFrame
* feature. This is used by the `Animation` class below and should not be called
@@ -379,6 +427,7 @@ var registry = publicWidget.registry;
registry.slider = publicWidget.Widget.extend({
selector: '.carousel',
disabledInEditableMode: false,
edit_events: {
'slid.bs.carousel': '_onEditionSlide',
},
@@ -669,7 +718,7 @@ registry.ul = publicWidget.Widget.extend({
registry.gallery = publicWidget.Widget.extend({
selector: '.o_gallery:not(.o_slideshow)',
xmlDependencies: ['/website/static/src/xml/website.gallery.xml'],
read_events: {
events: {
'click img': '_onClickImg',
},
@@ -741,6 +790,7 @@ registry.gallery = publicWidget.Widget.extend({
registry.gallerySlider = publicWidget.Widget.extend({
selector: '.o_slideshow',
xmlDependencies: ['/website/static/src/xml/website.gallery.xml'],
disabledInEditableMode: false,
/**
* @override
@@ -820,7 +870,7 @@ registry.gallerySlider = publicWidget.Widget.extend({
registry.socialShare = publicWidget.Widget.extend({
selector: '.oe_social_share',
xmlDependencies: ['/website/static/src/xml/website.share.xml'],
read_events: {
events: {
'mouseenter': '_onMouseEnter',
},
@@ -947,7 +997,7 @@ registry.facebookPage = publicWidget.Widget.extend({
registry.anchorSlide = publicWidget.Widget.extend({
selector: 'a[href^="/"][href*="#"], a[href^="#"]',
read_events: {
events: {
'click': '_onAnimateClick',
},
@@ -70,6 +70,18 @@ var WebsiteRoot = publicRootData.PublicRoot.extend({
'edit_translations': !!html.dataset.edit_translations,
}, this._super.apply(this, arguments));
},
/**
* @override
*/
_getPublicWidgetsRegistry: function (options) {
var registry = this._super.apply(this, arguments);
if (options.editableMode) {
return _.pick(registry, function (PublicWidget) {
return !PublicWidget.prototype.disabledInEditableMode;
});
}
return registry;
},
//--------------------------------------------------------------------------
// Handlers
@@ -246,10 +246,7 @@ options.registry.carousel = options.Class.extend({
}
});
_.defer(function () {
self.trigger_up('animation_start_demand', {
editableMode: true,
$target: self.$target,
});
self._refreshAnimations();
self.$target.carousel(index > 0 ? --index : cycle);
});
}
@@ -8,6 +8,7 @@ var _t = core._t;
sAnimation.registry.js_get_posts = sAnimation.Class.extend({
selector : '.js_get_posts',
disabledInEditableMode: false,
/**
* @override
@@ -5,7 +5,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteBlog = sAnimations.Class.extend({
selector: '.website_blog',
read_events: {
events: {
'click .cover_footer': '_onNextBlogClick',
'click a[href^="#blog_content"]': '_onContentAnchorClick',
'click .o_twitter, .o_facebook, .o_linkedin, .o_google, .o_twitter_complete, .o_facebook_complete, .o_linkedin_complete, .o_google_complete': '_onShareArticle',
@@ -5,7 +5,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.crmPartnerAssign = sAnimations.Class.extend({
selector: '#wrapwrap:has(.interested_partner_assign_form, .desinterested_partner_assign_form, .opp-stage-button, .new_opp_form)',
read_events: {
events: {
'click .interested_partner_assign_confirm': '_onInterestedPartnerAssignConfirm',
'click .desinterested_partner_assign_confirm': '_onDesinterestedPartnerAssignConfirm',
'click .opp-stage-button': '_onOppStageButtonClick',
@@ -5,7 +5,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteEventTrack = sAnimations.Class.extend({
selector: '.o_website_event',
read_events: {
events: {
'input #event_track_search': '_onEventTrackSearchInput',
},
@@ -12,7 +12,7 @@ var _t = core._t;
sAnimations.registry.websiteForum = sAnimations.Class.extend({
selector: '.website_forum',
xmlDependencies: ['/website_forum/static/src/xml/website_forum_share_templates.xml'],
read_events: {
events: {
'click .karma_required': '_onKarmaRequiredClick',
'mouseenter .o_js_forum_tag_follow': '_onTagFollowBoxMouseEnter',
'mouseleave .o_js_forum_tag_follow': '_onTagFollowBoxMouseLeave',
@@ -506,7 +506,7 @@ sAnimations.registry.websiteForum = sAnimations.Class.extend({
sAnimations.registry.websiteForumSpam = sAnimations.Class.extend({
selector: '.o_wforum_moderation_queue',
xmlDependencies: ['/website_forum/static/src/xml/website_forum_share_templates.xml'],
read_events: {
events: {
'click .o_wforum_select_all_spam': '_onSelectallSpamClick',
'click .o_wforum_mark_spam': 'async _onMarkSpamClick',
'input #spamSearch': '_onSpamSearchInput',
@@ -11,15 +11,15 @@ var ForumShare = sAnimations.registry.socialShare.extend({
selector: '',
xmlDependencies: sAnimations.registry.socialShare.prototype.xmlDependencies
.concat(['/website_forum/static/src/xml/website_forum_share_templates.xml']),
read_events: {},
events: {},
/**
* @override
* @param {Object} parent
* @param {boolean} editableMode
* @param {Object} options
* @param {string} targetType
*/
init: function (parent, editableMode, targetType) {
init: function (parent, options, targetType) {
this._super.apply(this, arguments);
this.targetType = targetType;
},
@@ -71,7 +71,7 @@ var ForumShare = sAnimations.registry.socialShare.extend({
sAnimations.registry.websiteForumShare = sAnimations.Class.extend({
selector: '.website_forum',
read_events: {
events: {
'click :not(.karma_required).oe_social_share_call': '_onShareCallClick',
},
@@ -339,7 +339,7 @@ var RecentLinks = Widget.extend({
sAnimations.registry.websiteLinks = sAnimations.Class.extend({
selector: '.o_website_links_create_tracked_url',
read_events: {
events: {
'click #filter-newest-links': '_onFilterNewestLinksClick',
'click #filter-most-clicked-links': '_onFilterMostClickedLinksClick',
'click #filter-recently-used-links': '_onFilterRecentlyUsedLinksClick',
@@ -150,7 +150,7 @@ var PieChart = Widget.extend({
sAnimations.registry.websiteLinksCharts = sAnimations.Class.extend({
selector: '.o_website_links_chart',
read_events: {
events: {
'click .graph-tabs li a': '_onGraphTabClick',
'click .copy-to-clipboard': '_onCopyToClipboardClick',
},
@@ -8,7 +8,7 @@ var _t = core._t;
sAnimations.registry.websiteLinksCodeEditor = sAnimations.Class.extend({
selector: '#wrapwrap:has(.o_website_links_edit_code)',
read_events: {
events: {
'click .o_website_links_edit_code': '_onEditCodeClick',
'click .o_website_links_cancel_edit': '_onCancelEditClick',
'submit #edit-code-form': '_onEditCodeFormSubmit',
@@ -5,6 +5,7 @@ var sAnimation = require('website.content.snippets.animation');
sAnimation.registry.follow = sAnimation.Class.extend({
selector: '.js_follow',
disabledInEditableMode: false,
start: function () {
var self = this;
@@ -5,7 +5,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteMailChannel = sAnimations.Class.extend({
selector: '#wrapwrap',
read_events: {
events: {
'click .o_mg_link_hide': '_onHideLinkClick',
'click .o_mg_link_show': '_onShowLinkClick',
'click button.o_mg_read_more': '_onReadMoreClick',
@@ -5,6 +5,7 @@ var sAnimation = require('website.content.snippets.animation');
sAnimation.registry.follow_alias = sAnimation.Class.extend({
selector: ".js_follow_alias",
disabledInEditableMode: false,
start: function () {
var self = this;
this.is_user = false;
@@ -6,6 +6,8 @@ var sAnimation = require('website.content.snippets.animation');
sAnimation.registry.subscribe = sAnimation.Class.extend({
selector: ".js_subscribe",
disabledInEditableMode: false,
start: function () {
var self = this;
@@ -65,6 +67,8 @@ sAnimation.registry.subscribe = sAnimation.Class.extend({
sAnimation.registry.newsletter_popup = sAnimation.Class.extend({
selector: ".o_newsletter_popup",
disabledInEditableMode: false,
start: function () {
var self = this;
@@ -9,7 +9,7 @@ var timeout;
sAnimations.registry.websiteSaleCartLink = sAnimations.Class.extend({
selector: '#top_menu a[href$="/shop/cart"]',
read_events: {
events: {
'mouseenter': '_onMouseEnter',
'mouseleave': '_onMouseLeave',
},
@@ -18,11 +18,6 @@ sAnimations.registry.websiteSaleCartLink = sAnimations.Class.extend({
* @override
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
this.$el.popover({
trigger: 'manual',
animation: true,
@@ -34,7 +29,7 @@ sAnimations.registry.websiteSaleCartLink = sAnimations.Class.extend({
placement: 'auto',
template: '<div class="popover mycart-popover" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>'
});
return def;
return this._super.apply(this, arguments);
},
//--------------------------------------------------------------------------
@@ -89,7 +84,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteSaleCategory = sAnimations.Class.extend({
selector: '#o_shop_collapse_category',
read_events: {
events: {
'click .fa-chevron-right': '_onOpenClick',
'click .fa-chevron-down': '_onCloseClick',
},
@@ -123,18 +118,15 @@ sAnimations.registry.websiteSaleCategory = sAnimations.Class.extend({
odoo.define('website_sale.website_sale', function (require) {
'use strict';
var utils = require('web.utils');
var ProductConfiguratorMixin = require('sale.ProductConfiguratorMixin');
var core = require('web.core');
var config = require('web.config');
var sAnimations = require('website.content.snippets.animation');
require("website.content.zoomodoo");
var _t = core._t;
sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorMixin, {
selector: '.oe_website_sale',
read_events: {
events: _.extend({}, ProductConfiguratorMixin.events || {}, {
'change form .js_product:first input[name="add_qty"]': '_onChangeAddQuantity',
'mouseup .js_publish': '_onMouseupPublish',
'touchend .js_publish': '_onMouseupPublish',
@@ -152,7 +144,7 @@ sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorM
'change #shipping_use_same': '_onChangeShippingUseSame',
'click .toggle_summary': '_onToggleSummary',
'click input.js_product_change': 'onChangeVariant',
},
}),
/**
* @constructor
@@ -170,9 +162,6 @@ sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorM
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
_.each(this.$('div.js_product'), function (product) {
$('input.js_product_change', product).first().trigger('change');
@@ -610,7 +599,7 @@ sAnimations.registry.WebsiteSale = sAnimations.Class.extend(ProductConfiguratorM
sAnimations.registry.websiteSaleCart = sAnimations.Class.extend({
selector: '.oe_website_sale .oe_cart',
read_events: {
events: {
'click .js_change_shipping': '_onClickChangeShipping',
'click .js_edit_address': '_onClickEditAddress',
'click .js_delete_product': '_onClickDeleteProduct',
@@ -10,9 +10,9 @@ require('website_sale.website_sale');
sAnimations.registry.WebsiteSaleOptions = sAnimations.Class.extend(ProductConfiguratorMixin, {
selector: '.oe_website_sale',
read_events: {
events: _.extend({}, ProductConfiguratorMixin.events || {}, {
'click #add_to_cart, #products_grid .product_price .a-submit': 'async _onClickAdd',
},
}),
/**
* @constructor
@@ -4,7 +4,7 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteSaleTracking = sAnimations.Class.extend({
selector: '.oe_website_sale',
read_events: {
events: {
'click form[action="/shop/cart/update"] a.a-submit': '_onAddProductIntoCart',
'click a[href="/shop/checkout"]': '_onCheckoutStart',
'click div.oe_cart a[href^="/web?redirect"][href$="/shop/checkout"]': '_onCustomerSignin',
@@ -17,10 +17,6 @@ sAnimations.registry.websiteSaleTracking = sAnimations.Class.extend({
*/
start: function () {
var self = this;
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
// Watching a product
if (this.$el.is('#product_detail')) {
@@ -50,7 +46,7 @@ sAnimations.registry.websiteSaleTracking = sAnimations.Class.extend({
});
}
return def;
return this._super.apply(this, arguments);
},
//--------------------------------------------------------------------------
@@ -61,7 +57,7 @@ sAnimations.registry.websiteSaleTracking = sAnimations.Class.extend({
* @private
*/
_trackGA: function () {
websiteGA = window.ga || function () {};
var websiteGA = window.ga || function () {};
websiteGA.apply(this, arguments);
},
/**
@@ -11,13 +11,8 @@ sAnimations.registry.websiteSaleValidate = sAnimations.Class.extend({
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
this._poll_nbr = 0;
this._paymentTransationPollStatus();
return def;
},
@@ -237,7 +237,7 @@ var ProductComparison = Widget.extend(ProductConfiguratorMixin, {
sAnimations.registry.ProductComparison = sAnimations.Class.extend({
selector: '.oe_website_sale',
read_events: {
events: {
'click .o_add_compare, .o_add_compare_dyn': '_onClickAddCompare',
'click #o_comparelist_table tr': '_onClickComparelistTr',
},
@@ -247,10 +247,6 @@ sAnimations.registry.ProductComparison = sAnimations.Class.extend({
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
this.productComparison = new ProductComparison(this);
return $.when(def, this.productComparison.appendTo(this.$el));
},
@@ -10,7 +10,7 @@ var dp = new concurrency.DropPrevious();
sAnimations.registry.websiteSaleDelivery = sAnimations.Class.extend({
selector: '.oe_website_sale',
read_events: {
events: {
'change select[name="shipping_id"]': '_onSetAddress',
'click #delivery_carrier .o_delivery_carrier_select': '_onCarrierClick',
},
@@ -10,7 +10,7 @@ var ProductConfiguratorMixin = require('sale.ProductConfiguratorMixin');
// in website_sale.js
sAnimations.registry.ProductWishlist = sAnimations.Class.extend(ProductConfiguratorMixin, {
selector: '.oe_website_sale',
read_events: {
events: {
'click #my_wish': '_onClickMyWish',
'click .o_add_wishlist, .o_add_wishlist_dyn': '_onClickAddWish',
'change input.product_id': '_onChangeVariant',
@@ -18,7 +18,6 @@ sAnimations.registry.ProductWishlist = sAnimations.Class.extend(ProductConfigura
'click .wishlist-section .o_wish_rm': '_onClickWishRemove',
'click .wishlist-section .o_wish_add': '_onClickWishAdd',
},
events: sAnimations.Class.events,
/**
* @constructor
@@ -36,9 +35,6 @@ sAnimations.registry.ProductWishlist = sAnimations.Class.extend(ProductConfigura
willStart: function () {
var self = this;
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
var wishDef = $.get('/shop/wishlist', {
count: 1,
@@ -56,9 +52,6 @@ sAnimations.registry.ProductWishlist = sAnimations.Class.extend(ProductConfigura
*/
start: function () {
var def = this._super.apply(this, arguments);
if (this.editableMode) {
return def;
}
this._updateWishlistView();
// trigger change on only one input
@@ -6,8 +6,6 @@ var sAnimations = require('website.content.snippets.animation');
sAnimations.registry.websiteSlides = sAnimations.Class.extend({
selector: '#wrapwrap',
read_events: {
},
/**
* @override
@@ -109,7 +109,7 @@ odoo.define('website_slides.add.section', function (require) {
sAnimations.registry.websiteSlidesSection = sAnimations.Class.extend({
selector: '.oe_slide_js_add_section',
xmlDependencies: ['/website_slides/static/src/xml/website_slides_upload.xml'],
read_events: {
events: {
'click': '_onAddSectionClick',
},
@@ -59,7 +59,7 @@ odoo.define('website_slides.delete.slide', function (require) {
sAnimations.registry.websiteSlidesDeleteSlide = sAnimations.Class.extend({
selector: '.oe_slide_js_delete_slide',
xmlDependencies: ['/website_slides/static/src/xml/website_slides_upload.xml'],
read_events: {
events: {
'click': '_onDeleteSlideClick',
},
@@ -41,7 +41,7 @@ var ShareMail = Widget.extend({
sAnimations.registry.websiteSlidesShare = sAnimations.Class.extend({
selector: '#wrapwrap',
read_events: {
events: {
'click a.o_slides_social_share': '_onSlidesSocialShare',
},
@@ -563,7 +563,7 @@ var SlideUploadDialog = Dialog.extend({
sAnimations.registry.websiteSlidesUpload = sAnimations.Class.extend({
selector: '.oe_slide_js_upload',
xmlDependencies: ['/website_slides/static/src/xml/website_slides_upload.xml'],
read_events: {
events: {
'click': '_onUploadClick',
},
@@ -584,9 +584,7 @@ sAnimations.registry.websiteSlidesUpload = sAnimations.Class.extend({
_openDialog: function ($element) {
var data = $element.data();
var dialog = new SlideUploadDialog(this, data)
dialog.appendTo(document.body);
return dialog.open();
return new SlideUploadDialog(this, data).open();
},
//--------------------------------------------------------------------------