|
1 | 1 | /*!
|
2 |
| - * CanvasInput v1.2.2 |
| 2 | + * CanvasInput v1.2.3 |
3 | 3 | * http://goldfirestudios.com/blog/108/CanvasInput-HTML5-Canvas-Text-Input
|
4 | 4 | *
|
5 |
| - * (c) 2013-2015, James Simpson of GoldFire Studios |
| 5 | + * (c) 2013-2016, James Simpson of GoldFire Studios |
6 | 6 | * goldfirestudios.com
|
7 | 7 | *
|
8 | 8 | * MIT License
|
|
783 | 783 | self._hasFocus = true;
|
784 | 784 | if (self._readonly) {
|
785 | 785 | self._hiddenInput.readOnly = true;
|
786 |
| - return; |
787 | 786 | } else {
|
788 | 787 | self._hiddenInput.readOnly = false;
|
789 |
| - } |
790 | 788 |
|
791 |
| - // update the cursor position |
792 |
| - self._cursorPos = (typeof pos === 'number') ? pos : self._clipText().length; |
| 789 | + // update the cursor position |
| 790 | + self._cursorPos = (typeof pos === 'number') ? pos : self._clipText().length; |
793 | 791 |
|
794 |
| - // clear the place holder |
795 |
| - if (self._placeHolder === self._value) { |
796 |
| - self._value = ''; |
797 |
| - self._hiddenInput.value = ''; |
798 |
| - } |
| 792 | + // clear the place holder |
| 793 | + if (self._placeHolder === self._value) { |
| 794 | + self._value = ''; |
| 795 | + self._hiddenInput.value = ''; |
| 796 | + } |
799 | 797 |
|
800 |
| - self._cursor = true; |
| 798 | + self._cursor = true; |
801 | 799 |
|
802 |
| - // setup cursor interval |
803 |
| - if (self._cursorInterval) { |
804 |
| - clearInterval(self._cursorInterval); |
| 800 | + // setup cursor interval |
| 801 | + if (self._cursorInterval) { |
| 802 | + clearInterval(self._cursorInterval); |
| 803 | + } |
| 804 | + self._cursorInterval = setInterval(function() { |
| 805 | + self._cursor = !self._cursor; |
| 806 | + self.render(); |
| 807 | + }, 500); |
805 | 808 | }
|
806 |
| - self._cursorInterval = setInterval(function() { |
807 |
| - self._cursor = !self._cursor; |
808 |
| - self.render(); |
809 |
| - }, 500); |
810 | 809 |
|
811 | 810 | // move the real focus to the hidden input
|
812 | 811 | var hasSelection = (self._selection[0] > 0 || self._selection[1] > 0);
|
|
0 commit comments