lib/onebox/helpers.rb in onebox-1.6.4 vs lib/onebox/helpers.rb in onebox-1.6.5
- old
+ new
@@ -55,10 +55,14 @@
def self.click_to_scroll_div(width = 690, height = 400)
"<div style=\"background:transparent;position:relative;width:#{width}px;height:#{height}px;top:#{height}px;margin-top:-#{height}px;\" onClick=\"style.pointerEvents='none'\"></div>"
end
def self.blank?(value)
- value.respond_to?(:empty?) ? !!value.empty? || !value[/\S/] : !value
+ if value.respond_to?(:blank?)
+ value.blank?
+ else
+ value.respond_to?(:empty?) ? !!value.empty? : !value
+ end
end
def self.truncate(string, length = 50)
string.size > length ? string[0..length] + "..." : string
end