o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1355857733.073379:@value"9{I"
class:EFI"ProcessedAsset; FI"logical_path; FI"6woople-theme/organization_dashboard_controller.js; TI"
pathname; FI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js; TI"content_type; FI"application/javascript; FI"
mtime; FI"2012-11-05T13:26:15-05:00; FI"length; FiI"digest; F"%9f0d9e04b34f1c280bdc88b320a95819I"source; FI"$(function() {
if ($('#organization-accounts')) new OrganizationDashboardController().init();
});
(function(){
function OrganizationDashboardController() {}
OrganizationDashboardController.prototype.init = function(debugMode) {
this.debugMode = debugMode !== null ? debugMode : false;
this.setupListeners();
this.log('initialize');
};
OrganizationDashboardController.prototype.setupListeners = function() {
this.log('setup listeners');
this.mobileSetup();
this.bindReminderButtons();
};
OrganizationDashboardController.prototype.mobileSetup = function() {
if (this.isPhone()) {
$('#organization-accounts button').addClass('btn-large');
} else {
this.createPopover();
}
};
OrganizationDashboardController.prototype.createPopover = function() {
$('#organization-accounts').popover({
selector: '.status-alert',
placement: 'top',
template: '
'
});
};
OrganizationDashboardController.prototype.bindReminderButtons = function() {
this.log('bind reminder button events');
var reminderClick = function(reminderPath, button) {
this.log('fire reminder callback');
this.sendReminder(reminderPath, button);
};
var clickBinder = function(button){
var reminderPath = $(button).data('reminder-path');
var debouncedClickHandler = _.debounce(reminderClick, 300); // avoid button click spamming.
var boundClickHandler = _.bind(debouncedClickHandler, this, reminderPath, button);
$(button).click(boundClickHandler);
};
var buttons = $('#organization-accounts .remind-column .btn');
_.each(buttons, clickBinder , this);
};
OrganizationDashboardController.prototype.sendReminder = function(reminderPath, button) {
$(button).prop('disabled', true);
$.ajax({
type : 'POST',
url : reminderPath,
context : button,
success : this.changeButton,
error : this.remindError
});
};
OrganizationDashboardController.prototype.changeButton = function(data, textStatus, jqXHR) {
$(this).addClass('btn-success sent');
};
OrganizationDashboardController.prototype.remindError = function(jqXHR, textStatus, errorThrown) {
alert($(this).data('errorMessage'));
$(this).prop('disabled', false);
};
OrganizationDashboardController.prototype.log = function(message) {
if (this.debugMode !== true) return;
console.log("[OrganizationDashboardController]", message);
};
OrganizationDashboardController.prototype.isPhone = function() {
return this.windowWidth() <= 480 ? true : false;
};
OrganizationDashboardController.prototype.windowWidth = function() {
return $(window).width();
};
this.OrganizationDashboardController = OrganizationDashboardController;
})(this);
; FI"dependency_digest; F"%51aee32b2c06c714518e29fa52942204I"required_paths; F[I"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js; TI"dependency_paths; F[{I" path; FI"z/Users/adamdoeler/Sites/bigbang/woople-theme/app/assets/javascripts/woople-theme/organization_dashboard_controller.js; TI"
mtime; FI"2012-11-05T13:26:15-05:00; FI"digest; F"%9f0d9e04b34f1c280bdc88b320a95819I"
_version; F"%6776f581a4329e299531e1d52aa59832