Skip to content

Commit

Permalink
Merge pull request #18 from hatone/addcss_delete
Browse files Browse the repository at this point in the history
changing buttons design
  • Loading branch information
hatone committed Feb 7, 2016
2 parents 078129f + 1b77afb commit c823623
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 22 deletions.
71 changes: 56 additions & 15 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -67,7 +67,7 @@ <h3>set your timezone:</h3>
<h3>add timezone:</h3>
<div id = "timezone_forms">
</div>
<div class="btn btn-danger" id="add_timezone"><span class="fui-plus-24"></span></div>
<div class="btng" id="add_timezone"><span class="fui-plus-24"></span></div>
<div class="modal-footer">
<input type="submit" class="btn btn-primary" />
</div>
Expand Down
16 changes: 10 additions & 6 deletions js/get_timezone_list.js
Expand Up @@ -39,7 +39,7 @@ function getTimezoneList(){
});
$('#timezone_forms').append('<br>');
$('#timezone_forms').append('<select class="timezones" id="tzbtn'+ltzindex+'">' + myTimezoneOptions + '</select>');
$('#timezone_forms').append('<button onclick = "deleteTimezone(event,'+ltzindex+');" form = "timezone_forms" id=dbtn'+ltzindex+'></button>');
$('#timezone_forms').append(' <button onclick = "deleteTimezone(event,'+ltzindex+');" form = "timezone_forms" id=dbtn'+ltzindex+'><span class="fui-cross-16"></span></button>');
myTimezoneOptions = "";
});
} else {
Expand Down Expand Up @@ -72,13 +72,17 @@ function addTimezone(){
txt = txt + '<option value="'+ index +'">' + tz.name + " (" + tz.difference + ")</option>";
});

var a = $("#timezone_forms").find("select").filter(":last").get(0);
console.log(a.id);
var index = parseInt(a.id.replace("tzbtn",""))+1;

var lastobj = $("#timezone_forms").find("select").filter(":last").get(0);
var index;
if(lastobj == null) {
index = 0;
} else {
index = parseInt(lastobj.id.replace("tzbtn",""))+1;
}

$('#timezone_forms').append('<br>');
$('#timezone_forms').append('<select class="timezones" id="tzbtn'+index+'">' + txt + '</select>');
$('#timezone_forms').append('<button onclick = "deleteTimezone(event,'+index+');" form = "timezone_forms" id=dbtn'+index+'></button>');
$('#timezone_forms').append(' <button onclick = "deleteTimezone(event,'+index+');" form = "timezone_forms" id=dbtn'+index+'><span class="fui-cross-16"></span></button>');
}
httpObj.send(null);
}
Expand Down

0 comments on commit c823623

Please sign in to comment.