Skip to content

Commit

Permalink
Merge pull request awesome-academy#206 from NguyenTanDuc/bugging20
Browse files Browse the repository at this point in the history
Fix bug redline width when resize window
  • Loading branch information
dieunb committed Jun 25, 2015
2 parents 3a05e97 + 48e7ffd commit 24d8676
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $(document).ready(function() {
var form_schedule = $(".new_schedule, .edit_schedule");

form_schedule.find("input[type=submit]").attr("disabled", "disabled");
form_schedule.areYouSure({message: "Are you sure you want to leave? The data you have entered may be not save"});
form_schedule.areYouSure();
form_schedule.bind("dirty.areYouSure", function(){
$(this).find("input[type=submit]").removeAttr("disabled");
});
Expand Down
10 changes: 3 additions & 7 deletions app/assets/javascripts/marcus_bains_line.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
function setTimeLine() {
var left, top, width;
var top;

if ($(".timeline").length === 0) {
if ($(".timeline").length === 0 && localStorage.getItem("view_type") != "month") {
timeline = $("<hr>").addClass("timeline");
$(".fc-time-grid-container").append(timeline);
$(".fc-today").append(timeline);
} else {
timeline = $(".timeline");
}
Expand All @@ -18,13 +18,9 @@ function setTimeLine() {
} else {
height = $(".fc-slats").height();
height_ratio = ((hour - minHour) * 3600 + now.getMinutes() * 60 + now.getSeconds()) / (maxHour - minHour) / 3600;
width = $(".fc-today").outerWidth();
left = $(".fc-today").position().left;
top = height_ratio * height;

timeline.css({
"width": width + "px",
"left": left + "px",
"top": top + "px"
});

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/timeline.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.timeline {
position: absolute;
position: relative;
border: none;
border-top: 1px solid red;
width: 100%;
Expand Down

0 comments on commit 24d8676

Please sign in to comment.