calendar.js: events made smaller (online) and other minor ui fixes
This commit is contained in:
parent
f1da8b4886
commit
2e593fada9
@ -1,5 +1,12 @@
|
|||||||
/**** CALENDAR ****/
|
/**** CALENDAR ****/
|
||||||
|
|
||||||
|
.cal_event {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
div.cal_body {
|
div.cal_body {
|
||||||
margin: 16px;
|
margin: 16px;
|
||||||
background-color: #DDD;
|
background-color: #DDD;
|
||||||
@ -62,7 +69,7 @@ div.cal_month_body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.cal_month_headtable {
|
.cal_month_headtable {
|
||||||
/*table-layout:fixed;*/
|
table-layout:fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,7 +90,7 @@ div.cal_month_body {
|
|||||||
|
|
||||||
table.cal_month_table {
|
table.cal_month_table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
/*table-layout:fixed;*/
|
table-layout:fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,6 +145,7 @@ div.cal_day_unit{
|
|||||||
|
|
||||||
table.cal_week_table {
|
table.cal_week_table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
table-layout: fixed;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -155,15 +163,3 @@ div.cal_week_unit{
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
cursor:pointer;
|
cursor:pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.cal_event_Public {
|
|
||||||
color: GREEN;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.cal_event_Private {
|
|
||||||
color: BLUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.cal_event_hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -13,6 +13,9 @@
|
|||||||
<button class="btn btn-small" onclick="erpnext.calendar.refresh('Month')">
|
<button class="btn btn-small" onclick="erpnext.calendar.refresh('Month')">
|
||||||
Month View
|
Month View
|
||||||
</button>
|
</button>
|
||||||
|
<button class="btn btn-small" onclick="erpnext.calendar.refresh()">
|
||||||
|
<i class="icon-refresh"></i> Refresh
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="cal_month_head">
|
<div class="cal_month_head">
|
||||||
<span class="cal_view_title"></span>
|
<span class="cal_view_title"></span>
|
||||||
|
|||||||
@ -115,8 +115,11 @@ Calendar.prototype.show_event = function(ev, cal_ev) {
|
|||||||
this.widgets['Ref Link'].innerHTML = '';
|
this.widgets['Ref Link'].innerHTML = '';
|
||||||
|
|
||||||
if(this.ev.ref_type) {
|
if(this.ev.ref_type) {
|
||||||
$(repl('<span>Reference: <a href="#Form/%(ref_type)s/%(ref_name)s" \
|
$(repl('<table style="width: 100%;"><tr>\
|
||||||
onclick="cur_dialog.hide()">%(ref_type)s: %(ref_name)s</a></span>', this.ev))
|
<td style="width: 30%"><b>Reference:</b></td>\
|
||||||
|
<td><a href="#Form/%(ref_type)s/%(ref_name)s" \
|
||||||
|
onclick="cur_dialog.hide()">%(ref_type)s: %(ref_name)s</a></td>\
|
||||||
|
</tr></table>', this.ev))
|
||||||
.appendTo(this.widgets['Ref Link'])
|
.appendTo(this.widgets['Ref Link'])
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -256,32 +259,28 @@ Calendar.prototype.refresh = function(viewtype){//Sets the viewtype of the Calen
|
|||||||
//------------------------------------------------------
|
//------------------------------------------------------
|
||||||
|
|
||||||
Calendar.CalEvent= function(doc, cal) {
|
Calendar.CalEvent= function(doc, cal) {
|
||||||
this.body = document.createElement('div');
|
|
||||||
this.link = $a(this.body, 'a', '', {}, locals['Event'][doc.name].description || '');
|
|
||||||
this.doc = doc;
|
|
||||||
var me = this;
|
var me = this;
|
||||||
|
me.doc = doc;
|
||||||
|
|
||||||
this.link.onclick = function() {
|
this.body = $("<div class='label cal_event'></div>")
|
||||||
if(me.doc.name) {
|
.html(doc.description)
|
||||||
cal.show_event(me.doc, me);
|
.css({"cursor":"pointer"})
|
||||||
}
|
.attr("data-event", doc.name)
|
||||||
|
.click(function() {
|
||||||
|
var doc = locals["Event"][$(this).attr("data-event")];
|
||||||
|
cal.show_event(doc, me);
|
||||||
|
})
|
||||||
|
|
||||||
|
this.show = function(vu) {
|
||||||
|
me.body
|
||||||
|
.html(me.doc.description)
|
||||||
|
.css({"width": ($(vu.body).width()-10)})
|
||||||
|
.appendTo(vu.body)
|
||||||
|
.removeClass("label-success").removeClass("label-info")
|
||||||
|
.addClass(me.doc.event_type=="Public" ? "label-success" : "label-info")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Calendar.CalEvent.prototype.show = function(vu) {
|
|
||||||
|
|
||||||
var t = this.doc.event_type;
|
|
||||||
this.my_class = 'cal_event_'+ t;
|
|
||||||
|
|
||||||
if(this.body.parentNode)
|
|
||||||
this.body.parentNode.removeChild(this.body);
|
|
||||||
vu.body.appendChild(this.body);
|
|
||||||
|
|
||||||
// refresh
|
|
||||||
this.link.innerHTML = this.doc.description || '';
|
|
||||||
this.body.className = this.my_class;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
@ -295,10 +294,13 @@ Calendar.View.prototype.init=function(cal) {
|
|||||||
|
|
||||||
|
|
||||||
Calendar.View.prototype.show=function() {
|
Calendar.View.prototype.show=function() {
|
||||||
this.get_events(); this.refresh(); this.body.style.display = 'block';
|
this.body.style.display = 'block';
|
||||||
|
this.get_events(); this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
Calendar.View.prototype.hide=function() { this.body.style.display = 'none';}
|
Calendar.View.prototype.hide=function() {
|
||||||
|
this.body.style.display = 'none';
|
||||||
|
}
|
||||||
|
|
||||||
Calendar.View.prototype.next = function() {
|
Calendar.View.prototype.next = function() {
|
||||||
var s = this.cal.selected_date;
|
var s = this.cal.selected_date;
|
||||||
@ -349,7 +351,8 @@ Calendar.MonthView.prototype.create_table = function() {
|
|||||||
var r = this.headtable.insertRow(0);
|
var r = this.headtable.insertRow(0);
|
||||||
for(var j=0;j<7;j++) {
|
for(var j=0;j<7;j++) {
|
||||||
var cell = r.insertCell(j);
|
var cell = r.insertCell(j);
|
||||||
cell.innerHTML = erpnext.calendar.weekdays[j]; $w(cell, (100 / 7) + '%');
|
cell.innerHTML = erpnext.calendar.weekdays[j];
|
||||||
|
$w(cell, (100 / 7) + '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
this.main = $a(this.body, 'div', 'cal_month_body');
|
this.main = $a(this.body, 'div', 'cal_month_body');
|
||||||
@ -480,7 +483,6 @@ Calendar.WeekView.prototype.create_table = function() {
|
|||||||
var r = this.headtable.insertRow(0);
|
var r = this.headtable.insertRow(0);
|
||||||
for(var j=0;j<8;j++) {
|
for(var j=0;j<8;j++) {
|
||||||
var cell = r.insertCell(j);
|
var cell = r.insertCell(j);
|
||||||
$w(cell, (100 / 8) + '%');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// hour header
|
// hour header
|
||||||
@ -652,9 +654,19 @@ Calendar.ViewUnit.prototype.deselect=function() { this.selected = false; this.se
|
|||||||
Calendar.ViewUnit.prototype.setevent=function() { }
|
Calendar.ViewUnit.prototype.setevent=function() { }
|
||||||
|
|
||||||
Calendar.MonthViewUnit=function(parent) {
|
Calendar.MonthViewUnit=function(parent) {
|
||||||
this.header = $a(parent, 'div' , "cal_month_date");
|
var me = this;
|
||||||
this.default_class = "cal_month_unit";
|
this.header = $("<div class='cal_month_date'></div>")
|
||||||
|
.appendTo(parent)
|
||||||
|
.css({"cursor":"pointer"})
|
||||||
|
.click(function() {
|
||||||
|
me.body.onclick();
|
||||||
|
})
|
||||||
|
.bind("dblclick", function() {
|
||||||
|
me.body.ondblclick();
|
||||||
|
})
|
||||||
|
.get(0);
|
||||||
|
|
||||||
|
this.default_class = "cal_month_unit";
|
||||||
this.init(parent);
|
this.init(parent);
|
||||||
|
|
||||||
this.onrefresh = function() {
|
this.onrefresh = function() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user