Skip to content

Commit

Permalink
Don't render when .settings is clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
archisman-panigrahi committed Jan 20, 2014
1 parent 92c856f commit d62b398
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ $(function() {
win = gui.Window.get()
win.show()
//win.showDevTools()
document.title = "Typhoon"
document.title = "Typhoon"

//Bind Handlers
$(".minimize").click(function() {
Expand Down Expand Up @@ -111,6 +111,7 @@ function generateStats(data, callback) {

function render(location) {
$('.border .sync').addClass('busy');
$(".border .settings").show()

getWeatherData(location, function(rawdata) {
generateStats(rawdata, function(weather) {
Expand Down Expand Up @@ -302,19 +303,19 @@ $(document).ready(function() {
});

function init_settings() {


//Prevents Dragging on certain elements
$('.border .settings, .border .sync, .border .close, .border .minimize, #locationModal, #errorMessage').click(function() {
if ($(this).hasClass("close")) {
window.close()
window.close()
} else if ($(this).hasClass("settings")) {
show_settings("all")
} else if ($(this).hasClass("sync")) {
render(localStorage.typhoon)
}
})
$('body').on("click", "a", function(e) {
$('body').on("click", "a", function(e) {
e.preventDefault()
gui.Shell.openExternal($(e.currentTarget).attr("href"))
})
Expand All @@ -329,7 +330,7 @@ function init_settings() {
typingTimer = setTimeout(doneTyping, doneTypingInterval)
}).keydown(function(){
//on keydown, clear the countdown
clearTimeout(typingTimer)
clearTimeout(typingTimer)
});

function doneTyping() {
Expand Down Expand Up @@ -368,12 +369,16 @@ function init_settings() {
$('#locationModal .toggleswitch span').click(function() {
$(this).parent().children().removeClass('selected')
localStorage.setItem("typhoon_" + $(this).parent().attr("class").replace("toggleswitch ", ""), $(this).addClass('selected').attr("data-type"))
$(".border .settings").hide()
})

//Color thing
$('.color span').click(function() {
localStorage.typhoon_color = $(this).attr("data-color")
background(null)
$('.color span[data-color=gradient]').click(function() {
$(".border .settings").hide()
})
})

//Control CSS
Expand All @@ -393,13 +398,6 @@ function show_settings(amount) {
$("#locationModal .full").hide()
}

if ($('#locationModal').css('display') != 'none') {
//We do a render instead
$(".border .sync").click()
$("#locationModal").fadeOut(350)
return;
}

//Show the Modal
$("#locationModal").fadeToggle(350)
if (amount != "noweather") {
Expand Down

6 comments on commit d62b398

@archisman-panigrahi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brackets should show spaces like Sublime Text 👻

@zlatanvasovic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. Depends on your settings. :)

@archisman-panigrahi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdroid How to change that settings?

@zlatanvasovic
Copy link
Contributor

@zlatanvasovic zlatanvasovic commented on d62b398 Jan 21, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@archisman-panigrahi
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zdroid Dots will show spaces and hyphen will show tabs when selected like this.
sublime

@zlatanvasovic
Copy link
Contributor

@zlatanvasovic zlatanvasovic commented on d62b398 Jan 21, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.