Skip to content

Commit

Permalink
Working on #11, rearange code and add some documentation to understan…
Browse files Browse the repository at this point in the history
…d better how content is defined and populated
  • Loading branch information
sebasira committed Mar 29, 2024
1 parent 3fa47c8 commit 09a9bf9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions js/jq.schedule.plus.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
}

// ブロック内容の追加
// EVENT CARD CONTENT DEFINITION
var $content = jQuery('<span class="head"><span class="startTime time"></span>~<span class="endTime time"></span></span><span class="text"></span>');

// SEBASIRA #8 Full opacity override
Expand All @@ -239,21 +240,30 @@
var stext = startDate + ' ' + element.formatTime(data["start"]);
var etext = endDate + ' ' + element.formatTime(data["end"]);
var snum = element.getScheduleCount(data["timeline"]);

// APPLY DATA/INFO TO CONTENT
$bar.find(".startTime").text(stext);
$bar.find(".endTime").text(etext);
if (data["text"]) {
$bar.find(".text").text(data["text"]);
}

// EVENT CARD CONFIGURATION
$bar.css({
left: (st * setting.widthTimeX),
top: ((snum * setting.timeLineY) + setting.timeLinePaddingTop),
width: ((et - st) * setting.widthTimeX),
height: (setting.timeLineY) - 2
});
$bar.find(".startTime").text(stext);
$bar.find(".endTime").text(etext);
if (data["text"]) {
$bar.find(".text").text(data["text"]);
}

if (data["class"]) {
$bar.addClass(data["class"]);
}

// Add sc_Bar (aka EventCard) to timeline
$element.find('.sc_main .timeline').eq(data["timeline"]).append($bar);


// LIN データの追加
scheduleData.push(data);
// key
Expand Down

0 comments on commit 09a9bf9

Please sign in to comment.