Changeset 4436
- Timestamp:
- Mar 8, 2013, 10:08:54 AM (10 years ago)
- Location:
- trunk/client/servlet
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/client/servlet/src/org/proteios/action/file/InspectActiveSpectrumFile.java
r4031 r4436 406 406 { 407 407 plotOriginal = new Image(); 408 plotOriginal.setId("msPlotOriginal"); 408 409 ActionLink viewOriginalAction = getActionFactory().getActionLink( 409 410 PlotFileSpectrum.class, "ViewOriginal"); … … 418 419 fileId, spectrumId, (String) null, (String) null); 419 420 plotOriginal.setImageMap(imageMap); 421 // Set onMousedown and onMouseup strings 422 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 423 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 424 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 425 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 426 plotOriginal.setOnDragstartStr("return false;"); 427 plotOriginal.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 428 plotOriginal.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 420 429 } 421 430 Image plot = new Image(); 431 plot.setId("msPlot"); 422 432 ActionLink viewAction = getActionFactory().getActionLink( 423 433 PlotFileSpectrum.class, "View"); … … 435 445 spectrumId, massCutoffLowStr, massCutoffHighStr); 436 446 plot.setImageMap(imageMap); 447 // Set onMousedown and onMouseup strings 448 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 449 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 450 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 451 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 452 plot.setOnDragstartStr("return false;"); 453 plot.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 454 plot.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 437 455 /*********************************************************************** 438 456 * Spectrum iteration buttons … … 562 580 // Row container for plot and properties form 563 581 RowContainer rc = new RowContainer(); 582 rc.add(plot); 564 583 if (plotOriginal != null) 565 584 { 566 585 rc.add(plotOriginal); 567 586 } 568 rc.add(plot);569 587 rc.add(spectrumIterationForm); 570 588 rc.add(massRangeSelectionForm); -
trunk/client/servlet/src/org/proteios/action/hit/ViewActiveHitSpectrum.java
r4003 r4436 241 241 { 242 242 plotOriginal = new Image(); 243 plotOriginal.setId("msPlotOriginal"); 243 244 ActionLink viewOriginalAction = getActionFactory().getActionLink( 244 245 PlotFileSpectrum.class, "ViewOriginal"); … … 252 253 (String) null, (String) null); 253 254 plotOriginal.setImageMap(imageMap); 255 // Set onMousedown and onMouseup strings 256 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 257 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 258 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 259 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 260 plotOriginal.setOnDragstartStr("return false;"); 261 plotOriginal.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 262 plotOriginal.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 254 263 } 255 264 Image plot = new Image(); 265 plot.setId("msPlot"); 256 266 ActionLink viewAction = getActionFactory().getActionLink( 257 267 PlotFileSpectrum.class, "View"); … … 267 277 massCutoffLowStr, massCutoffHighStr); 268 278 plot.setImageMap(imageMap); 279 // Set onMousedown and onMouseup strings 280 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 281 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 282 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 283 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 284 plot.setOnDragstartStr("return false;"); 285 plot.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 286 plot.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 269 287 /*********************************************************************** 270 288 * Spectrum mass range selection form … … 303 321 ColumnContainer cc = new ColumnContainer(); 304 322 RowContainer rc = new RowContainer(); 323 rc.add(plot); 305 324 if (plotOriginal != null) 306 325 { 307 326 rc.add(plotOriginal); 308 327 } 309 rc.add(plot);310 328 rc.add(massRangeSelectionForm); 311 329 cc.add(rc); -
trunk/client/servlet/src/org/proteios/action/peakList/ViewActivePeakList.java
r4003 r4436 127 127 { 128 128 plotOriginal = new Image(); 129 plotOriginal.setId("msPlotOriginal"); 129 130 ActionLink viewOriginalAction = getActionFactory().getActionLink( 130 131 PlotSpectrum.class, "ViewOriginal"); … … 137 138 (String) null, (String) null); 138 139 plotOriginal.setImageMap(imageMap); 140 // Set onMousedown and onMouseup strings 141 int spectrumOffsetLeft = plotSpectrum.getSpectrumOffsetLeft(); 142 int spectrumOffsetRight = plotSpectrum.getSpectrumOffsetRight(); 143 Double massMin = plotSpectrum.getSpectrumLimitMassMin(); 144 Double massMax = plotSpectrum.getSpectrumLimitMassMax(); 145 plotOriginal.setOnDragstartStr("return false;"); 146 plotOriginal.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 147 plotOriginal.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 139 148 } 140 149 Image plot = new Image(); 150 plot.setId("msPlot"); 141 151 ActionLink viewAction = getActionFactory().getActionLink( 142 152 PlotSpectrum.class, "View"); … … 151 161 massCutoffLowStr, massCutoffHighStr); 152 162 plot.setImageMap(imageMap); 163 // Set onMousedown and onMouseup strings 164 int spectrumOffsetLeft = plotSpectrum.getSpectrumOffsetLeft(); 165 int spectrumOffsetRight = plotSpectrum.getSpectrumOffsetRight(); 166 Double massMin = plotSpectrum.getSpectrumLimitMassMin(); 167 Double massMax = plotSpectrum.getSpectrumLimitMassMax(); 168 plot.setOnDragstartStr("return false;"); 169 plot.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 170 plot.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 153 171 /*********************************************************************** 154 172 * Spectrum mass range selection form … … 174 192 ColumnContainer cc = new ColumnContainer(); 175 193 RowContainer rc = new RowContainer(); 194 rc.add(plot); 176 195 if (plotOriginal != null) 177 196 { 178 197 rc.add(plotOriginal); 179 198 } 180 rc.add(plot); 181 rc.add(massRangeSelectionForm); 199 rc.add(massRangeSelectionForm); 182 200 cc.add(rc); 183 201 cc.add(propertiesForm); -
trunk/client/servlet/src/org/proteios/action/spectrumSearch/ViewActivePeptideSearchResult.java
r4011 r4436 193 193 { 194 194 plotOriginal = new Image(); 195 plotOriginal.setId("msPlotOriginal"); 195 196 ActionLink viewOriginalAction = getActionFactory().getActionLink( 196 197 PlotFileSpectrum.class, "ViewOriginal"); … … 204 205 (String) null, (String) null); 205 206 plotOriginal.setImageMap(imageMap); 207 // Set onMousedown and onMouseup strings 208 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 209 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 210 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 211 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 212 plotOriginal.setOnDragstartStr("return false;"); 213 plotOriginal.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 214 plotOriginal.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plotOriginal.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 206 215 } 207 216 Image plot = new Image(); 217 plot.setId("msPlot"); 208 218 ActionLink viewAction = getActionFactory().getActionLink( 209 219 PlotFileSpectrum.class, "View"); … … 219 229 massCutoffLowStr, massCutoffHighStr); 220 230 plot.setImageMap(imageMap); 231 // Set onMousedown and onMouseup strings 232 int spectrumOffsetLeft = plotFileSpectrum.getSpectrumOffsetLeft(); 233 int spectrumOffsetRight = plotFileSpectrum.getSpectrumOffsetRight(); 234 Double massMin = plotFileSpectrum.getSpectrumLimitMassMin(); 235 Double massMax = plotFileSpectrum.getSpectrumLimitMassMax(); 236 plot.setOnDragstartStr("return false;"); 237 plot.setOnMousedownStr("setMouseDownMassCutoffValue(event, 'massCutoffLowStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 238 plot.setOnMouseupStr("setMouseUpMassCutoffValue(event, 'massCutoffHighStr', '" + plot.getId() + "', " + PlotFileSpectrum.WIDTH + ", " + spectrumOffsetLeft + ", " + spectrumOffsetRight + ", " + massMin + ", " + massMax + ")"); 221 239 // Spectrum mass range selection form 222 240 Form massRangeSelectionForm = new MassRangeForm(massCutoffLowStr, massCutoffHighStr, spectrumId); … … 233 251 // Row container for plot and properties form 234 252 RowContainer rc = new RowContainer(); 253 rc.add(plot); 235 254 if (plotOriginal != null) 236 255 { 237 256 rc.add(plotOriginal); 238 257 } 239 rc.add(plot);240 258 rc.add(massRangeSelectionForm); 241 259 cc.add(rc); -
trunk/client/servlet/www/static/js/script.js
r4422 r4436 59 59 function getElement(id) 60 60 { 61 return document.all ? document.all[id] : document.getElementById(id); 61 if (id != null && id != '') 62 { 63 return document.all ? document.all[id] : document.getElementById(id); 64 } 65 else 66 { 67 return null; 68 } 62 69 } 63 70 … … 171 178 { 172 179 var tableRows = table.rows; 173 for(var i = 0; i<tableRows.length;i++) 174 { 175 var row = tableRows[i]; 176 addHiliteEvents(row); 180 if (tableRows != null) 181 { 182 for(var i = 0; i<tableRows.length;i++) 183 { 184 var row = tableRows[i]; 185 addHiliteEvents(row); 186 } 177 187 } 178 188 } … … 385 395 window.onresize=resize_all_iframes; 386 396 387 function updateNodeText(nodeId, nodeText) 397 /** 398 * Returns a JSON object with element position for upper left corner. 399 * Code from http://www.kirupa.com/html5/get_element_position_using_javascript.htm 400 * 401 * @param GUIelement element The GUI element to get the position for. 402 * @return JSON object with keys 'x' and 'y' with position values. 403 */ 404 function getElementPosition(element) 405 { 406 var xPos = 0; 407 var yPos = 0; 408 // Add relative offsets for element parents 409 while (element) 410 { 411 xPos += (element.offsetLeft - element.scrollLeft + element.clientLeft); 412 yPos += (element.offsetTop - element.scrollTop + element.clientTop); 413 element = element.offsetParent; 414 } 415 return {x: xPos, y: yPos}; 416 } 417 418 /** 419 * Returns the last element with a given name. 420 * 421 * @param elementName Name of the GUIElements. 422 * @return GUIElement The last element with given name. 423 */ 424 function getLastElementByName(elementName) 425 { 426 var element = null; 427 if (elementName != null && elementName != '') 428 { 429 var elArray = document.getElementsByName(elementName); 430 if (elArray != null) 431 { 432 // Get last element 433 element = elArray[elArray.length - 1]; 434 } 435 } 436 return element; 437 } 438 439 function updateNodeFirstChildText(nodeId, nodeText) 388 440 { 389 441 var node = document.getElementById(nodeId); … … 474 526 } 475 527 // Update table cell data 476 updateNode Text(cellId, "" + cellData);528 updateNodeFirstChildText(cellId, "" + cellData); 477 529 } 478 530 } … … 485 537 { 486 538 setInterval('updateJobTableColumns()', 1000*secondsBetweenUpdates); 539 } 540 541 /** 542 * Returns a mass value corresponding to an x-position in a mass spectrum image. 543 * Returns null if any argument values are invalid. 544 * 545 * @param e event The event to get position from 546 * @param imgId String The element id of the spectrum img tag in the html page 547 * @param spectrumWidth int The spectrum width in pixels 548 * @param spectrumOffsetLeft int The spectrum offset from the left image border in pixels 549 * @param spectrumOffsetRight int The spectrum offset from the right image border in pixels 550 * @param massMin double The lowest mass value in the displayed spectrum 551 * @param massMax double The highest mass value in the displayed spectrum 552 */ 553 function fetchMassValue(e, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax) 554 { 555 // Return if basic arguments are missing or have odd values 556 if (imgId == null || imgId == '' || massMin == null || massMax == null || massMin == massMax) 557 { 558 //alert('Returned at check 1'); 559 return null; 560 } 561 // Return if effective spectrum width or massrange are <= 0 562 var spectrumEffWidth = spectrumWidth - spectrumOffsetLeft - spectrumOffsetRight; 563 var massRange = massMax - massMin; 564 if (spectrumEffWidth <= 0 || massRange <= 0) 565 { 566 //alert('Returned at check 2 spectrumEffWidth = ' + spectrumEffWidth + ' massRange = ' + massRange); 567 return null; 568 } 569 // Get image element 570 var imgEl = document.getElementById(imgId); 571 if (imgEl == null) 572 { 573 return null; 574 } 575 // Get position on page for event 576 var x = e.pageX; 577 // Get relative position inside current GUI element 578 var xRel = 0; 579 var pos = getElementPosition(imgEl); 580 xRel = x - pos.x; 581 var spectrumPixelOffsetLeft = xRel - spectrumOffsetLeft; 582 var mass = null; 583 // Return if basic arguments are missing or have odd values 584 if (massMin == null || massMax == null || massMin == massMax) 585 { 586 //alert('Returned at check 3'); 587 return null; 588 } 589 // Return if effective spectrum width or massrange are <= 0 590 var spectrumEffWidth = spectrumWidth - spectrumOffsetLeft - spectrumOffsetRight; 591 var massRange = massMax - massMin; 592 if (spectrumEffWidth <= 0 || massRange <= 0) 593 { 594 //alert('Returned at check 4 spectrumEffWidth = ' + spectrumEffWidth + ' massRange = ' + massRange); 595 return null; 596 } 597 var spectrumPixelOffsetLeft = xRel - spectrumOffsetLeft; 598 // Calculate mass value from event pixel coordinate 599 mass = massMin + (spectrumPixelOffsetLeft/spectrumEffWidth)*massRange; 600 // Round mass value to nearest integer 601 mass = Math.floor(mass + 0.5); 602 return mass; 603 } 604 605 /** 606 * Returns a mass cuttoff string corresponding to an x-position in a mass spectrum image. 607 * Returns null if any argument values are invalid. 608 * 609 * @param e event The event to get position from 610 * @param inputElName String The element name of the mass cutoff input field in the html page 611 * @param imgId String The element id of the spectrum img tag in the html page 612 * @param spectrumWidth int The spectrum width in pixels 613 * @param spectrumOffsetLeft int The spectrum offset from the left image border in pixels 614 * @param spectrumOffsetRight int The spectrum offset from the right image border in pixels 615 * @param massMin double The lowest mass value in the displayed spectrum 616 * @param massMax double The highest mass value in the displayed spectrum 617 */ 618 function fetchMassCutoffStr(e, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax) 619 { 620 // Get mass value (equals null if any input argument values are invalid) 621 var mass = fetchMassValue(e, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax); 622 if (mass == null) 623 { 624 return null; 625 } 626 // Get mass cutoff string 627 var massCutoffStr = ''; 628 if (mass >= massMin && mass <= massMax) 629 { 630 // Mouse event inside spectrum range, set mass value 631 massCutoffStr = '' + mass; 632 } 633 else if (mass < massMin) 634 { 635 // Mouse event below spectrum range, set mass value to below lowest mass 636 massCutoffStr = '' + (massMin - 0.1).toFixed(1); 637 } 638 else if (mass > massMax) 639 { 640 // Mouse event above spectrum range, set mass value to above highest mass 641 massCutoffStr = '' + (massMax + 0.1).toFixed(1); 642 } 643 return massCutoffStr; 644 } 645 646 var lastMouseDownMassCutoffStr = ''; 647 var isNextClickReservedForMouseUpEvent = false; 648 649 /** 650 * Converts an event in a spectrum image to a mass value and 651 * sets mass cutoff value to the found mass. 652 * In order to support setting of cutoff masses using 653 * two clicks instead of dragging, a mass cutoff 654 * value will not be set if isMouseUpMassCutoffValueSet == 0. 655 * 656 * @param e event The event to get position from 657 * @param inputElName String The element name of the mass cutoff input field in the html page 658 * @param imgId String The element id of the spectrum img tag in the html page 659 * @param spectrumWidth int The spectrum width in pixels 660 * @param spectrumOffsetLeft int The spectrum offset from the left image border in pixels 661 * @param spectrumOffsetRight int The spectrum offset from the right image border in pixels 662 * @param massMin double The lowest mass value in the displayed spectrum 663 * @param massMax double The highest mass value in the displayed spectrum 664 */ 665 function setMouseDownMassCutoffValue(e, inputElName, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax) 666 { 667 if (isNextClickReservedForMouseUpEvent) 668 { 669 // Mouse click reserved for mouse up event 670 //alert('setMouseDownMassCutoffValue(): isNextClickReservedForMouseUpEvent = ' + isNextClickReservedForMouseUpEvent); 671 return; 672 } 673 // Prevent default dragging of image in older browsers 674 e.preventDefault(); 675 if (inputElName == null || inputElName == '') 676 { 677 //alert('setMouseDownMassCutoffValue(): inputElName == ' + inputElName); 678 return; 679 } 680 // Get mass cutoff string (equals null if any input argument values are invalid) 681 var massCutoffStr = fetchMassCutoffStr(e, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax); 682 if (massCutoffStr == null) 683 { 684 //alert('setMouseDownMassCutoffValue(): massCutoffStr == null'); 685 return; 686 } 687 // Get input field element 688 var inputEl = getLastElementByName(inputElName); 689 if (inputEl == null) 690 { 691 //alert('setMouseDownMassCutoffValue(): inputEl == null'); 692 return; 693 } 694 // Set input field value 695 inputEl.value = massCutoffStr; 696 // Set focus to input field 697 inputEl.focus(); 698 // Store value set 699 lastMouseDownMassCutoffStr = massCutoffStr; 700 } 701 702 /** 703 * Converts an event in a spectrum image to a mass value and 704 * sets mass cutoff value to the found mass. 705 * In order to support setting of cutoff masses using 706 * two clicks instead of dragging, a mass cutoff 707 * value will not be set if the mass value equals lastMouseDownMassCutoffStr. 708 * 709 * @param e event The event to get position from 710 * @param inputElName String The element name of the mass cutoff input field in the html page 711 * @param imgId String The element id of the spectrum img tag in the html page 712 * @param spectrumWidth int The spectrum width in pixels 713 * @param spectrumOffsetLeft int The spectrum offset from the left image border in pixels 714 * @param spectrumOffsetRight int The spectrum offset from the right image border in pixels 715 * @param massMin double The lowest mass value in the displayed spectrum 716 * @param massMax double The highest mass value in the displayed spectrum 717 */ 718 function setMouseUpMassCutoffValue(e, inputElName, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax) 719 { 720 // Prevent default dragging of image in older browsers 721 e.preventDefault(); 722 if (inputElName == null || inputElName == '') 723 { 724 //alert('setMouseUpMassCutoffValue(): inputElName == ' + inputElName); 725 return; 726 } 727 // Get mass cutoff string (equals null if any input argument values are invalid) 728 var massCutoffStr = fetchMassCutoffStr(e, imgId, spectrumWidth, spectrumOffsetLeft, spectrumOffsetRight, massMin, massMax); 729 if (massCutoffStr == null) 730 { 731 //alert('setMouseUpMassCutoffValue(): massCutoffStr == null'); 732 return; 733 } 734 if (massCutoffStr == lastMouseDownMassCutoffStr) 735 { 736 // No drag, mouse click intended for mouse down event 737 //alert('setMouseDownMassCutoffValue(): massCutoffStr == lastMouseDownMassCutoffStr = ' + massCutoffStr); 738 isNextClickReservedForMouseUpEvent = true; 739 return; 740 } 741 // Get input field element 742 var inputEl = getLastElementByName(inputElName); 743 if (inputEl == null) 744 { 745 //alert('setMouseUpMassCutoffValue(): inputEl == null'); 746 return; 747 } 748 // Set input field value 749 inputEl.value = massCutoffStr; 750 // Set focus to input field 751 inputEl.focus(); 752 // Set isNextClickReservedForMouseUpEvent to false 753 isNextClickReservedForMouseUpEvent = false; 487 754 } 488 755
Note: See TracChangeset
for help on using the changeset viewer.