Browse Source

#4530 Add tooltip (title) to the 'remove all' 'X' icon. (#5291)

* #4530 Add tooltip (title) to the 'remove all' 'X' icon.

* #4530 Add tooltip (title) to the 'remove all' 'X' icon.

* #4530 Add tooltip (title) to the 'remove all'

* Revert dist folder.

* add tk.js from pull request.
Nisha Kaushik 6 years ago
parent
commit
14a059d7ee
59 changed files with 197 additions and 1 deletions
  1. 3 0
      src/js/select2/i18n/af.js
  2. 3 0
      src/js/select2/i18n/ar.js
  3. 3 0
      src/js/select2/i18n/az.js
  4. 3 0
      src/js/select2/i18n/bg.js
  5. 3 0
      src/js/select2/i18n/bs.js
  6. 3 0
      src/js/select2/i18n/ca.js
  7. 3 0
      src/js/select2/i18n/cs.js
  8. 3 0
      src/js/select2/i18n/da.js
  9. 3 0
      src/js/select2/i18n/de.js
  10. 4 0
      src/js/select2/i18n/dsb.js
  11. 3 0
      src/js/select2/i18n/el.js
  12. 3 0
      src/js/select2/i18n/en.js
  13. 3 0
      src/js/select2/i18n/es.js
  14. 3 0
      src/js/select2/i18n/et.js
  15. 3 0
      src/js/select2/i18n/eu.js
  16. 3 0
      src/js/select2/i18n/fa.js
  17. 3 0
      src/js/select2/i18n/fi.js
  18. 3 0
      src/js/select2/i18n/fr.js
  19. 3 0
      src/js/select2/i18n/gl.js
  20. 3 0
      src/js/select2/i18n/he.js
  21. 3 0
      src/js/select2/i18n/hi.js
  22. 3 0
      src/js/select2/i18n/hr.js
  23. 4 0
      src/js/select2/i18n/hsb.js
  24. 3 0
      src/js/select2/i18n/hu.js
  25. 3 0
      src/js/select2/i18n/hy.js
  26. 3 0
      src/js/select2/i18n/id.js
  27. 3 0
      src/js/select2/i18n/is.js
  28. 3 0
      src/js/select2/i18n/it.js
  29. 3 0
      src/js/select2/i18n/ja.js
  30. 3 0
      src/js/select2/i18n/ka.js
  31. 3 0
      src/js/select2/i18n/km.js
  32. 3 0
      src/js/select2/i18n/ko.js
  33. 3 0
      src/js/select2/i18n/lt.js
  34. 3 0
      src/js/select2/i18n/lv.js
  35. 3 0
      src/js/select2/i18n/mk.js
  36. 3 0
      src/js/select2/i18n/ms.js
  37. 3 0
      src/js/select2/i18n/nb.js
  38. 3 0
      src/js/select2/i18n/nl.js
  39. 3 0
      src/js/select2/i18n/pl.js
  40. 3 0
      src/js/select2/i18n/ps.js
  41. 3 0
      src/js/select2/i18n/pt-BR.js
  42. 3 0
      src/js/select2/i18n/pt.js
  43. 3 0
      src/js/select2/i18n/ro.js
  44. 3 0
      src/js/select2/i18n/ru.js
  45. 3 0
      src/js/select2/i18n/sk.js
  46. 3 0
      src/js/select2/i18n/sl.js
  47. 3 0
      src/js/select2/i18n/sq.js
  48. 3 0
      src/js/select2/i18n/sr-Cyrl.js
  49. 3 0
      src/js/select2/i18n/sr.js
  50. 3 0
      src/js/select2/i18n/sv.js
  51. 3 0
      src/js/select2/i18n/th.js
  52. 4 0
      src/js/select2/i18n/tk.js
  53. 3 0
      src/js/select2/i18n/tr.js
  54. 3 0
      src/js/select2/i18n/uk.js
  55. 3 0
      src/js/select2/i18n/vi.js
  56. 3 0
      src/js/select2/i18n/zh-CN.js
  57. 3 0
      src/js/select2/i18n/zh-TW.js
  58. 3 1
      src/js/select2/selection/allowClear.js
  59. 20 0
      tests/selection/allowClear-tests.js

+ 3 - 0
src/js/select2/i18n/af.js

@@ -39,6 +39,9 @@ define(function () {
     },
     searching: function () {
       return 'Besig…';
+    },
+    removeAllItems: function () {
+      return 'Verwyder alle items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ar.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'جاري البحث…';
+    },
+     removeAllItems: function () {
+      return 'قم بإزالة كل العناصر';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/az.js

@@ -22,6 +22,9 @@ define(function () {
     },
     searching: function () {
       return 'Axtarılır…';
+    },
+     removeAllItems: function () {
+      return 'Bütün elementləri sil';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/bg.js

@@ -42,6 +42,9 @@ define(function () {
     },
     searching: function () {
       return 'Търсене…';
+    },
+    removeAllItems: function () {
+      return 'Премахнете всички елементи';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/bs.js

@@ -50,6 +50,9 @@ define(function () {
     },
     searching: function () {
       return 'Pretraga…';
+    },
+    removeAllItems: function () {
+      return 'Uklonite sve stavke';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ca.js

@@ -47,6 +47,9 @@ define(function () {
     },
     searching: function () {
       return 'Cercant…';
+    },
+    removeAllItems: function () {
+      return 'Treu tots els elements';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/cs.js

@@ -56,6 +56,9 @@ define(function () {
     },
     searching: function () {
       return 'Vyhledávání…';
+    },
+    removeAllItems: function () {
+      return 'Odstraňte všechny položky';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/da.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return 'Søger…';
+    },
+    removeAllItems: function () {
+      return 'Fjern alle elementer';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/de.js

@@ -35,6 +35,9 @@ define(function () {
     },
     searching: function () {
       return 'Suche…';
+    },
+    removeAllItems: function () {
+      return 'Entferne alle Gegenstände';
     }
   };
 });

+ 4 - 0
src/js/select2/i18n/dsb.js

@@ -43,6 +43,10 @@ define(function () {
     },
     searching: function () {
       return 'Pyta se…';
+    },
+    removeAllItems: function () {
+      // To DO : in Lower Sorbian.
+      return 'Remove all items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/el.js

@@ -47,6 +47,9 @@ define(function () {
     },
     searching: function () {
       return 'Αναζήτηση…';
+    },
+    removeAllItems: function () {
+      return 'Καταργήστε όλα τα στοιχεία';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/en.js

@@ -39,6 +39,9 @@ define(function () {
     },
     searching: function () {
       return 'Searching…';
+    },
+    removeAllItems: function () {
+      return 'Remove all items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/es.js

@@ -47,6 +47,9 @@ define(function () {
     },
     searching: function () {
       return 'Buscando…';
+    },
+    removeAllItems: function () {
+      return 'Eliminar todos los elementos';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/et.js

@@ -48,6 +48,9 @@ define(function () {
     },
     searching: function () {
       return 'Otsin…';
+    },
+    removeAllItems: function () {
+      return 'Eemalda kõik esemed';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/eu.js

@@ -46,6 +46,9 @@ define(function () {
     },
     searching: function () {
       return 'Bilatzen…';
+    },
+    removeAllItems: function () {
+      return 'Kendu elementu guztiak';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/fa.js

@@ -33,6 +33,9 @@ define(function () {
     },
     searching: function () {
       return 'در حال جستجو...';
+    },
+    removeAllItems: function () {
+      return 'همه موارد را حذف کنید';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/fi.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'Haetaan…';
+    },
+    removeAllItems: function () {
+      return 'Poista kaikki kohteet';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/fr.js

@@ -28,6 +28,9 @@ define(function () {
     },
     searching: function () {
       return 'Recherche en cours…';
+    },
+    removeAllItems: function () {
+      return 'Supprimer tous les articles';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/gl.js

@@ -34,6 +34,9 @@ define(function () {
     },
     searching: function () {
       return 'Buscando…';
+    },
+    removeAllItems: function () {
+      return 'Elimina todos os elementos';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/he.js

@@ -51,6 +51,9 @@ define(function () {
     },
     searching: function () {
       return 'מחפש…';
+    },
+    removeAllItems: function () {
+      return 'הסר את כל הפריטים';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/hi.js

@@ -34,6 +34,9 @@ define(function () {
     },
     searching: function () {
       return 'खोज रहा है...';
+    },
+    removeAllItems: function () {
+      return 'सभी वस्तुओं को हटा दें';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/hr.js

@@ -39,6 +39,9 @@ define(function () {
     },
     searching: function () {
       return 'Pretraga…';
+    },
+    removeAllItems: function () {
+      return 'Ukloni sve stavke';
     }
   };
 });

+ 4 - 0
src/js/select2/i18n/hsb.js

@@ -43,6 +43,10 @@ define(function () {
     },
     searching: function () {
       return 'Pyta so…';
+    },
+    removeAllItems: function () {
+      // To DO : in Upper Sorbian.
+      return 'Remove all items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/hu.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'Keresés…';
+    },
+    removeAllItems: function () {
+      return 'Távolítson el minden elemet';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/hy.js

@@ -33,6 +33,9 @@ define(function () {
     },
     searching: function () {
       return 'Որոնում․․․';
+    },
+    removeAllItems: function () {
+      return 'Հեռացնել բոլոր տարրերը';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/id.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'Mencari…';
+    },
+    removeAllItems: function () {
+      return 'Hapus semua item';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/is.js

@@ -36,6 +36,9 @@ define(function () {
     },
     searching: function () {
       return 'Leita…';
+    },
+    removeAllItems: function () {
+      return 'Fjarlægðu öll atriði';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/it.js

@@ -43,6 +43,9 @@ define(function () {
     },
     searching: function () {
       return 'Sto cercando…';
+    },
+    removeAllItems: function () {
+      return 'Rimuovi tutti gli oggetti';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ja.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return '検索しています…';
+    },
+    removeAllItems: function () {
+      return 'すべてのアイテムを削除';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ka.js

@@ -32,6 +32,9 @@ define(function () {
     },
     searching: function () {
       return 'ძიება…';
+    },
+    removeAllItems: function () {
+      return 'ამოიღე ყველა ელემენტი';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/km.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return 'កំពុងស្វែងរក...';
+    },
+    removeAllItems: function () {
+      return 'លុបធាតុទាំងអស់';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ko.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return '검색 중…';
+    },
+    removeAllItems: function () {
+      return '모든 항목 삭제';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/lt.js

@@ -47,6 +47,9 @@ define(function () {
     },
     searching: function () {
       return 'Ieškoma…';
+    },
+    removeAllItems: function () {
+      return 'Pašalinti visus elementus';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/lv.js

@@ -46,6 +46,9 @@ define(function () {
     },
     searching: function () {
       return 'Meklēšana…';
+    },
+    removeAllItems: function () {
+      return 'Noņemt visus vienumus';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/mk.js

@@ -42,6 +42,9 @@ define(function () {
     },
     searching: function () {
       return 'Пребарување…';
+    },
+    removeAllItems: function () {
+      return 'Отстрани ги сите предмети';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ms.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'Mencari…';
+    },
+    removeAllItems: function () {
+      return 'Keluarkan semua item';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/nb.js

@@ -25,6 +25,9 @@ define(function () {
     },
     searching: function () {
       return 'Søker…';
+    },
+    removeAllItems: function () {
+      return 'Fjern alle elementer';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/nl.js

@@ -38,6 +38,9 @@ define(function () {
     },
     searching: function () {
       return 'Zoeken…';
+    },
+    removeAllItems: function () {
+      return 'Verwijder alle items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/pl.js

@@ -40,6 +40,9 @@ define(function () {
     },
     searching: function () {
       return 'Trwa wyszukiwanie…';
+    },
+    removeAllItems: function () {
+      return 'Usuń wszystkie przedmioty';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ps.js

@@ -40,6 +40,9 @@ define(function () {
     },
     searching: function () {
       return 'لټول کيږي...';
+    },
+    removeAllItems: function () {
+      return 'ټول توکي لرې کړئ';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/pt-BR.js

@@ -41,6 +41,9 @@ define(function () {
     },
     searching: function () {
       return 'Buscando…';
+    },
+    removeAllItems: function () {
+      return 'Remover todos os itens';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/pt.js

@@ -35,6 +35,9 @@ define(function () {
     },
     searching: function () {
       return 'A procurar…';
+    },
+    removeAllItems: function () {
+      return 'Remover todos os itens';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ro.js

@@ -41,6 +41,9 @@ define(function () {
     },
     searching: function () {
       return 'Căutare…';
+    },
+    removeAllItems: function () {
+      return 'Eliminați toate elementele';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/ru.js

@@ -53,6 +53,9 @@ define(function () {
     },
     searching: function () {
       return 'Поиск…';
+    },
+    removeAllItems: function () {
+      return 'Удалить все элементы';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sk.js

@@ -54,6 +54,9 @@ define(function () {
     },
     searching: function () {
       return 'Vyhľadávanie…';
+    },
+    removeAllItems: function () {
+      return 'Odstráňte všetky položky';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sl.js

@@ -49,6 +49,9 @@ define(function () {
     },
     searching: function () {
       return 'Iščem…';
+    },
+    removeAllItems: function () {
+      return 'Odstranite vse elemente';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sq.js

@@ -40,6 +40,9 @@ define(function () {
     },
     searching: function () {
       return 'Duke kërkuar…';
+    },
+    removeAllItems: function () {
+      return 'Hiq të gjitha sendet';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sr-Cyrl.js

@@ -50,6 +50,9 @@ define(function () {
     },
     searching: function () {
       return 'Претрага…';
+    },
+    removeAllItems: function () {
+      return 'Уклоните све ставке';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sr.js

@@ -50,6 +50,9 @@ define(function () {
     },
     searching: function () {
       return 'Pretraga…';
+    },
+    removeAllItems: function () {
+      return 'Уклоните све ставке';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/sv.js

@@ -32,6 +32,9 @@ define(function () {
     },
     searching: function () {
       return 'Söker…';
+    },
+    removeAllItems: function () {
+      return 'Ta bort alla objekt';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/th.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return 'กำลังค้นข้อมูล…';
+    },
+    removeAllItems: function () {
+      return 'ลบรายการทั้งหมด';
     }
   };
 });

+ 4 - 0
src/js/select2/i18n/tk.js

@@ -31,6 +31,10 @@ define(function () {
     },
     searching: function () {
       return 'Gözlenýär…';
+    },
+    removeAllItems: function () {
+      // TO DO : add in turkmen,
+      return 'Remove all items';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/tr.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return 'Aranıyor…';
+    },
+    removeAllItems: function () {     
+      return 'Tüm öğeleri kaldır';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/uk.js

@@ -38,6 +38,9 @@ define(function () {
     },
     searching: function () {
       return 'Пошук…';
+    },
+    removeAllItems: function () {     
+      return 'Видалити всі елементи';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/vi.js

@@ -32,6 +32,9 @@ define(function () {
     },
     searching: function () {
       return 'Đang tìm…';
+    },
+    removeAllItems: function () {     
+      return 'Xóa tất cả các mục';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/zh-CN.js

@@ -31,6 +31,9 @@ define(function () {
     },
     searching: function () {
       return '搜索中…';
+    },
+    removeAllItems: function () {     
+      return '删除所有项目';
     }
   };
 });

+ 3 - 0
src/js/select2/i18n/zh-TW.js

@@ -28,6 +28,9 @@ define(function () {
     },
     searching: function () {
       return '搜尋中…';
+    },
+    removeAllItems: function () {     
+      return '刪除所有項目';
     }
   };
 });

+ 3 - 1
src/js/select2/selection/allowClear.js

@@ -97,8 +97,10 @@ define([
       return;
     }
 
+    var removeAll = this.options.get('translations').get('removeAllItems');   
+
     var $remove = $(
-      '<span class="select2-selection__clear">' +
+      '<span class="select2-selection__clear" title="' + removeAll() +'">' +
         '&times;' +
       '</span>'
     );

+ 20 - 0
tests/selection/allowClear-tests.js

@@ -79,6 +79,26 @@ test('clear is displayed for placeholder', function (assert) {
   );
 });
 
+test('clear icon should have title displayed', function (assert) {
+  var selection = new AllowClearPlaceholder(
+    $('#qunit-fixture .single-with-placeholder'),
+    allowClearOptions
+  );
+
+  var $selection = selection.render();
+
+  selection.update([{
+    id: 'one',
+    test: 'one'
+  }]);
+
+  assert.equal(
+    $selection.find('.select2-selection__clear').attr('title'),
+    'Remove all items',
+    'The clear icon should have title displayed'
+  );
+});
+
 test('clicking clear will set the placeholder value', function (assert) {
   var $element = $('#qunit-fixture .single-with-placeholder');