From f6bd7ce9e102679b23507c5010e349511799d645 Mon Sep 17 00:00:00 2001 From: Dexter V Date: Wed, 26 Mar 2014 15:24:13 -0700 Subject: [PATCH] Call BW::Device explicitly instead of Device Removes the assumption that Device == BW::Device to prevent errors if Device has already been defined. --- lib/formotion/patch/ui_text_field.rb | 4 ++-- lib/formotion/row_type/base.rb | 2 +- lib/formotion/row_type/number_row.rb | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/formotion/patch/ui_text_field.rb b/lib/formotion/patch/ui_text_field.rb index 07eccd6..a455dd4 100644 --- a/lib/formotion/patch/ui_text_field.rb +++ b/lib/formotion/patch/ui_text_field.rb @@ -115,7 +115,7 @@ def textFieldShouldEndEditing(theTextField) return self.textFieldShouldEndEditing_callback.call(theTextField) end - if Device.ios_version >= "7.0" + if BW::Device.ios_version >= "7.0" theTextField.text = theTextField.text.gsub("\u00a0", " ").strip end @@ -134,7 +134,7 @@ def textField(theTextField, shouldChangeCharactersInRange:range, replacementStri end # fix for UITextField in iOS7 http://stackoverflow.com/questions/19569688/uitextfield-spacebar-does-not-advance-cursor-in-ios-7/20129483#20129483 - if Device.ios_version >= "7.0" + if BW::Device.ios_version >= "7.0" if range.location == theTextField.text.length && string == " " theTextField.text = theTextField.text.stringByAppendingString("\u00a0") return false diff --git a/lib/formotion/row_type/base.rb b/lib/formotion/row_type/base.rb index 710feba..8a00ea0 100644 --- a/lib/formotion/row_type/base.rb +++ b/lib/formotion/row_type/base.rb @@ -4,7 +4,7 @@ class Base attr_accessor :row, :tableView def self.field_buffer - if Device.iphone? or App.window.size.width <= 320 or Device.ios_version >= "7.0" + if BW::Device.iphone? or App.window.size.width <= 320 or BW::Device.ios_version >= "7.0" 20 else 64 diff --git a/lib/formotion/row_type/number_row.rb b/lib/formotion/row_type/number_row.rb index 92f4e61..5c58e2b 100644 --- a/lib/formotion/row_type/number_row.rb +++ b/lib/formotion/row_type/number_row.rb @@ -5,7 +5,7 @@ module RowType class NumberRow < StringRow def keyboardType - if Device.ipad? + if BW::Device.ipad? return UIKeyboardTypeNumberPad end UIKeyboardTypeDecimalPad @@ -13,4 +13,4 @@ def keyboardType end end -end \ No newline at end of file +end