プロジェクト

全般

プロフィール

Vote #63609

完了

Use of Prototype's Element-methods (like this.up("form"))

Admin Redmine さんが3年以上前に追加. 3年以上前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
UI_10
対象バージョン:
開始日:
2008/07/14
期日:
進捗率:

0%

予定工数:
category_id:
10
version_id:
2
issue_org_id:
1636
author_id:
1591
assigned_to_id:
0
comments:
1
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

In /views/issues/_list.rhtml for example you use "this.up('form')". Actually the up-method is not available on the element itself, but only by the element, when it is returned by the $() method.

Quote from the Prototype-Documentation:

Prototype adds many convenience methods to elements returned by the $() function.

So, the correct way would be using: $(this).up('form') or Element.up(this,'form')

In IE7 the up method is actually not available on "this". In your case it's working "accidentially", because there is a call to $$('.hascontextmenu') executed somewhere in context_menu.js during page load, and by that the up-method is added to all DOM elements.

To better understand the problem check out this example (make sure to set the correct path and filename to prototype.js)




  



  
CLICK HERE

Regards,
Chris


journals

Fixed in r1667.
Thanks for your tip.
--------------------------------------------------------------------------------

Admin Redmine さんが3年以上前に更新

  • カテゴリUI_10 にセット
  • 対象バージョン0.8_2 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0