Skip to content

Commit

Permalink
Rename "settings" modal to "nickname" modal, since that's it's only p…
Browse files Browse the repository at this point in the history
…urpose. Fixes #22
  • Loading branch information
aroman committed Mar 23, 2013
1 parent 78f91a2 commit 5e5c16e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 20 deletions.
2 changes: 1 addition & 1 deletion static/js/templates.min.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions static/js/views.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ StatusView = Backbone.View.extend({
});

// Represents the modal which allows the user
// to edit their account settings.
SettingsView = Backbone.View.extend({
// to edit their nickname
NicknameModalView = Backbone.View.extend({

el: $("#settings-modal"),
template: Handlebars.templates.settings,
el: $("#nickname-modal"),
template: Handlebars.templates.nickname,

events: {
"click button#save": "save"
Expand Down Expand Up @@ -883,7 +883,7 @@ AppView = Backbone.View.extend({
events: {
"click #toggle-details": "toggleDetails",
"click #toggle-archived": "toggleArchived",
"click #settings": "showSettings",
"click #nickname": "showNicknameModal",
"click #shortcuts": "showShortcuts",
"click #add-course": "addCourse",
"click #force-refresh": "forceRefresh",
Expand All @@ -894,7 +894,7 @@ AppView = Backbone.View.extend({
var that = this;
// Create models & collections
window.settings = new Settings;
window.settings_view = new SettingsView({model: settings});
window.nickname_modal_view = new NicknameModalView({model: settings});
window.app_status = new Status;
window.status_view = new StatusView({model: app_status});

Expand Down Expand Up @@ -964,7 +964,7 @@ AppView = Backbone.View.extend({
_.defer(function () {
$(".btn, input[type='checkbox']").not('.details-show').prop('disabled', true);
});
$("#force-refresh, #settings, #logout").addClass('disabled-dropdown-item');
$("#force-refresh, #nickname, #logout").addClass('disabled-dropdown-item');
},

enableControls: function () {
Expand All @@ -973,7 +973,7 @@ AppView = Backbone.View.extend({
_.defer(function () {
$(".btn, input[type='checkbox']").not('.details-show').prop('disabled', false);
});
$("#force-refresh, #settings, #logout").removeClass('disabled-dropdown-item');
$("#force-refresh, #nickname, #logout").removeClass('disabled-dropdown-item');
},

refresh: function () {
Expand Down Expand Up @@ -1142,8 +1142,8 @@ AppView = Backbone.View.extend({
return false;
},

showSettings: function () {
window.settings_view.show();
showNicknameModal: function () {
window.nickname_modal_view.show();
$('.dropdown-toggle').dropdown();
return false;
},
Expand Down
4 changes: 0 additions & 4 deletions views/app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,4 @@ block content
window.app.updateUpcoming();
window.app.updateCourses();

if (settings.get('details') === true) {
window.app.showDetails()
}

Backbone.history.start({pushState: true, root: "/app/"});
6 changes: 3 additions & 3 deletions views/layout-app.jade
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ block navbar
a#toggle-details(target='_self', href="") Show details
li.divider
li
a#settings(href="settings", data-bypass)
i.icon-wrench
| Settings
a#nickname(href="nickname", data-bypass)
i.icon-user
| Nickname
li
a#shortcuts(href="shortcuts", data-bypass)
i.icon-list-alt
Expand Down
4 changes: 2 additions & 2 deletions views/modals.jade
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#settings-modal.modal.hide.fade
#nickname-modal.modal.hide.fade
.modal-header
a.close.close-button(data-dismiss="modal") ×
h3
| Settings
| What shall I call you?
.modal-body
.modal-footer
button.btn.btn-primary(href="#", id="save") Save
Expand Down
File renamed without changes.

0 comments on commit 5e5c16e

Please sign in to comment.