summaryrefslogtreecommitdiffstats
path: root/codebase/sources/ext/dhtmlxscheduler_limit.js
diff options
context:
space:
mode:
authorAlexKlimenkov <shurick.klimenkov@gmail.com>2014-11-12 12:31:30 +0300
committerAlexKlimenkov <shurick.klimenkov@gmail.com>2014-11-12 12:31:30 +0300
commitb43931167c3a3229c89608fe0cac8cc6f28db9d5 (patch)
treea21af26a5b6fb026be2210d20263ae820337f99e /codebase/sources/ext/dhtmlxscheduler_limit.js
parent18d5b85296811c84235763e3b39eb6f7715e8d19 (diff)
downloadscheduler-b43931167c3a3229c89608fe0cac8cc6f28db9d5.zip
scheduler-b43931167c3a3229c89608fe0cac8cc6f28db9d5.tar.gz
scheduler-b43931167c3a3229c89608fe0cac8cc6f28db9d5.tar.bz2
[update] version 4.2.0
Diffstat (limited to 'codebase/sources/ext/dhtmlxscheduler_limit.js')
-rw-r--r--codebase/sources/ext/dhtmlxscheduler_limit.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/codebase/sources/ext/dhtmlxscheduler_limit.js b/codebase/sources/ext/dhtmlxscheduler_limit.js
index e56abc5..3fd070a 100644
--- a/codebase/sources/ext/dhtmlxscheduler_limit.js
+++ b/codebase/sources/ext/dhtmlxscheduler_limit.js
@@ -1,5 +1,5 @@
/*
-dhtmlxScheduler v.4.1.0 Stardard
+dhtmlxScheduler v.4.2.0 Stardard
This software is covered by GPL license. You also can obtain Commercial or Enterprise license to use it in non-GPL project - please contact sales@dhtmlx.com. Usage without proper license is prohibited.
@@ -47,11 +47,22 @@ scheduler._temp_limit_scope = function(){
return scheduler.deleteMarkedTimespan(options);
};
scheduler.attachEvent("onBeforeViewChange",function(om,od,nm,nd){
+
+ function isBlocked(date, mode){
+ var limit_start = scheduler.config.limit_start,
+ limit_end = scheduler.config.limit_end,
+ date_end = scheduler.date.add(date,1,mode);
+
+ return (date.valueOf() > limit_end.valueOf() || date_end <= limit_start.valueOf());
+ }
+
if (scheduler.config.limit_view){
nd = nd||od; nm = nm||om;
- if (nd.valueOf()>scheduler.config.limit_end.valueOf() || this.date.add(nd,1,nm)<=scheduler.config.limit_start.valueOf()){
+ if (isBlocked(nd, nm) && !(od.valueOf() == nd.valueOf())){
setTimeout(function(){
- scheduler.setCurrentView((od || scheduler.config.limit_start), nm);
+ var resetDate = !isBlocked(od, nm) ? od : scheduler.config.limit_start;
+
+ scheduler.setCurrentView(!isBlocked(resetDate, nm) ? resetDate : null, nm);
},1);
return false;
}
@@ -613,7 +624,7 @@ scheduler._temp_limit_scope = function(){
if (this._props && this._props[this._mode] && options.sections && options.sections[this._mode]) {
var view = this._props[this._mode];
- index = view.order[options.sections[this._mode]];
+ index = this._get_section_sday(options.sections[this._mode]);
if (view.size && (index > view.position+view.size)) {
index = 0;
}