Changeset 3071

Show
Ignore:
Timestamp:
11/24/10 13:49:15
Author:
johnsa
Message:

personal client: enable 24 hour/ workday switch in scheduling widget

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/css/bwScheduling.css

    r3064 r3071  
    196196#bwScheduleControls td.time { 
    197197  padding-left: 1em; 
     198} 
     199#bwScheduleControls td.schedDate { 
     200  min-width: 410px; 
    198201} 
    199202#bwScheduleControls input.alldayFlag { 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js

    r3068 r3071  
    576576      // number of days to display 
    577577      var range = getDayRange(this.startRange, this.endRange); 
    578       // number of hours to display 
    579       var hourRange = this.endHoursRange - this.startHoursRange
    580       var startHour = this.startHoursRange
    581        
    582       if (!this.workday) { 
    583         // show full 24 hours in grid 
    584         hourRange = 24
    585         startHour = 0
     578      // number of hours to display, default to 24 hour mode 
     579      var hourRange = 24
     580      var startHour = 0
     581       
     582      if (this.workday) { 
     583        // show only workday hours in grid 
     584        hourRange = this.endHoursRange - this.startHoursRange
     585        startHour = this.startHoursRange
    586586      } 
    587587       
     
    12011201       
    12021202      // toggle 24 hour mode - can be done with text or with checkbox 
    1203       $("#bwSched24HoursText").click(function() { 
    1204         if($("#bwSched24HoursCb").attr('checked')) { 
    1205           $("#bwSched24HoursCb").removeAttr('checked'); 
    1206           bwGrid.workday = false; 
    1207         } else { 
    1208           $("#bwSched24HoursCb").attr('checked','checked'); 
    1209           bwGrid.workday = true; 
    1210         } 
    1211         //bwGrid.display(); 
    1212       }); 
    1213       $("#bwSched24HoursCb").click(function() { 
    1214         if($(this).checked) { 
     1203      // checkbox handler: 
     1204      function switchSched24() { 
     1205        if($("#bwSched24HoursCb").is(":checked")) { 
    12151206          bwGrid.workday = false; 
    12161207        } else { 
    12171208          bwGrid.workday = true; 
    12181209        } 
    1219         bwGrid.display(); 
    1220       }); 
    1221        
    1222        
     1210        // must unbind the click event from the checkbox or we'll stack up events 
     1211        $("#bwSched24HoursCb").unbind("click", switchSched24); 
     1212        bwGrid.display();  
     1213      } 
     1214      // text handler: checks or unchecks the box 
     1215      function switchSched24Text() { 
     1216        if($("#bwSched24HoursCb").is(":checked")) { 
     1217          $("#bwSched24HoursCb").removeAttr('checked'); 
     1218        } else { 
     1219          $("#bwSched24HoursCb").attr('checked','checked'); 
     1220        } 
     1221        // must unbind the click event from the checkbox or we'll stack up events 
     1222        $("#bwSched24HoursText").unbind("click", switchSched24Text); 
     1223        switchSched24(); 
     1224      } 
     1225      // bind the text and the checkbox to the handlers 
     1226      $("#bwSched24HoursCb").click(switchSched24); 
     1227      $("#bwSched24HoursText").click(switchSched24Text); 
    12231228       
    12241229      // if we change the main tab's start date, time, or duration, update the meeting tab