Skip to content

Instantly share code, notes, and snippets.

@amitm
Created October 4, 2013 16:20
Show Gist options
  • Save amitm/6828628 to your computer and use it in GitHub Desktop.
Save amitm/6828628 to your computer and use it in GitHub Desktop.
//
// Sign Up Modal /////////////////////////////////////////////////////////
define(function (require) {
"use strict";
var Backbone = require('backbone'),
$ = require('jquery'),
$utils = require('core/utils'),
SignUpModal = require('./SignUpModal');
require('bootstrap');
var SignUpModalPinterest = SignUpModal.extend({
el: $('.individual_hukk_modal'),
initialize: function() {
SignUpModal.prototype.initialize.call(this);
_.bindAll(this, 'signUpSuccess');
},
show: function () {
this.$el.on('shown', function() {
this.$el.find('input[name="email"]').focus();
}.bind(this));
this.$el.modal('show');
},
signUpSuccess: function(response) {
if (response.response.result === 'success') {
$(".signup_error").hide();
hukksterEmbed.hukkIt(this.$el.find('.js-hukk-it')[0],
response.data[0].short_id);
$(document).on('__hukkkster:bookmarklet_hide', function() {
window.location = '/my-hukks';
});
// This has to be handled differently if the item is sold out
// This has to be handled differently if the item is sold out
} else {
SignUpModal.prototype.signUpSuccess.call(this, response);
}
},
});
return SignUpModalPinterest;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment