Changed tipsy
bzr revid: nicolas.vanhoren@openerp.com-20120906141646-r9wgdi9uhjdd5124
This commit is contained in:
parent
56e2d8984d
commit
6eec6cf691
|
@ -3,24 +3,32 @@ openerp.hr_attendance = function (instance) {
|
|||
|
||||
var QWeb = instance.web.qweb;
|
||||
var _t = instance.web._t;
|
||||
var _lt = instance.web._lt;
|
||||
|
||||
var tips = {
|
||||
"true": _lt("You are currently signed in. Click here to sign out."),
|
||||
"false": _lt("You are currently signed out. Click here to sign in."),
|
||||
}
|
||||
|
||||
instance.hr_attendance.AttendanceSlider = instance.web.Widget.extend({
|
||||
template: 'AttendanceSlider',
|
||||
init: function (parent) {
|
||||
this._super(parent);
|
||||
this.set({"signed_in": false});
|
||||
},
|
||||
start: function() {
|
||||
var self = this;
|
||||
this.on("change:signed_in", this, function() {
|
||||
this.$el.toggleClass("oe_attendance_nosigned", ! this.get("signed_in"));
|
||||
this.$el.toggleClass("oe_attendance_signed", this.get("signed_in"));
|
||||
this.$el.attr("title", tips["" + this.get("signed_in")].toString());
|
||||
});
|
||||
this.$(".oe_attendance_signin").click(function() {
|
||||
self.do_update_attendance();
|
||||
}).tipsy();
|
||||
});
|
||||
this.$(".oe_attendance_signout").click(function() {
|
||||
self.do_update_attendance();
|
||||
}).tipsy();
|
||||
});
|
||||
return this.check_attendance();
|
||||
},
|
||||
do_update_attendance: function () {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<template>
|
||||
<t t-name="AttendanceSlider">
|
||||
<div class="oe_attendance_status oe_attendance_nosigned">
|
||||
<div class="oe_attendance_signin" t-att-title="_t('You are currently signed out. Click here to sign in.')"></div>
|
||||
<div class="oe_attendance_signout" t-att-title="_t('You are currently signed in. Click here to sign out.')"></div>
|
||||
<div class="oe_attendance_signin"></div>
|
||||
<div class="oe_attendance_signout"></div>
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
|
|
Loading…
Reference in New Issue