How to show edit Profile information as a popup

Edit Profile information as a pop up from SCA webstore . By default, editing the profile information is not available as a popup.

Javascript

events: {
			'submit form': 'save'
		,	'change input[data-type="phone"]': 'formatPhone'
		,	'click [data-action="change-email"]': 'changeEmail'
		,	'click [data-action="edit"]': 'edit'
		}
,	edit: function()
	{
			var model = new ProfilePersonalinfoEditModel(this.model.attributes);

			var view = new ProfilePersonalinfoEditView({
				application: this.application
			,	model: model
			});
			
			var self = this;

			model.on('save', function(){
				view.showSuccess(self.$('[data-type="alert-placeholder"]'));
			})

			view.useLayoutError = true;

			this.application.getLayout().showInModal(view);

	}
	,	showSuccess: function ()
		{
			if (this.$savingForm)
			{
				var global_view_message = new GlobalViewsMessageView({
						message: _(' successfully updated!').translate()
					,	type: 'success'
					,	closable: true
				});
				this.showContent();
				this.$('[data-type="alert-placeholder"]').append(global_view_message.render().$el.html());
			}
		}

Leave a comment

Your email address will not be published. Required fields are marked *