Browse Source

#1896, add 'get id' to all modules with element namespace, move uniqueID generation to 'create id'

pull/1785/merge
jlukic 9 years ago
parent
commit
91b2ffdf49
4 changed files with 12 additions and 15 deletions
  1. 10
      src/definitions/modules/dropdown.js
  2. 6
      src/definitions/modules/modal.js
  3. 4
      src/definitions/modules/popup.js
  4. 7
      src/definitions/modules/sidebar.js

10
src/definitions/modules/dropdown.js

@ -141,9 +141,9 @@ $.fn.dropdown = function(parameters) {
create: { create: {
id: function() { id: function() {
module.verbose('Creating unique id for element');
id = module.get.uniqueID();
id = (Math.random().toString(16) + '000000000').substr(2,8);
elementNamespace = '.' + id; elementNamespace = '.' + id;
module.verbose('Creating unique id for element', id);
} }
}, },
@ -823,6 +823,9 @@ $.fn.dropdown = function(parameters) {
}, },
get: { get: {
id: function() {
return id;
},
text: function() { text: function() {
return $text.text(); return $text.text();
}, },
@ -970,9 +973,6 @@ $.fn.dropdown = function(parameters) {
value = module.get.text(); value = module.get.text();
} }
return $selectedItem || false; return $selectedItem || false;
},
uniqueID: function() {
return (Math.random().toString(16) + '000000000').substr(2,8);
} }
}, },

6
src/definitions/modules/modal.js

@ -120,9 +120,9 @@ $.fn.modal = function(parameters) {
$dimmer = $dimmable.dimmer('get dimmer'); $dimmer = $dimmable.dimmer('get dimmer');
}, },
id: function() { id: function() {
module.verbose('Creating unique id for element');
id = module.get.uniqueID();
id = (Math.random().toString(16) + '000000000').substr(2,8);
elementNamespace = '.' + id; elementNamespace = '.' + id;
module.verbose('Creating unique id for element', id);
} }
}, },
@ -192,7 +192,7 @@ $.fn.modal = function(parameters) {
}, },
get: { get: {
uniqueID: function() {
id: function() {
return (Math.random().toString(16) + '000000000').substr(2,8); return (Math.random().toString(16) + '000000000').substr(2,8);
} }
}, },

4
src/definitions/modules/popup.js

@ -246,9 +246,9 @@ $.fn.popup = function(parameters) {
}, },
createID: function() { createID: function() {
module.verbose('Creating unique id for element');
id = module.get.uniqueID();
id = (Math.random().toString(16) + '000000000').substr(2,8);
elementNamespace = '.' + id; elementNamespace = '.' + id;
module.verbose('Creating unique id for element', id);
}, },
// determines popup state // determines popup state

7
src/definitions/modules/sidebar.js

@ -114,8 +114,8 @@ $.fn.sidebar = function(parameters) {
create: { create: {
id: function() { id: function() {
module.verbose('Creating unique id for element');
id = module.get.uniqueID();
id = (Math.random().toString(16) + '000000000').substr(2,8);
module.verbose('Creating unique id for element', id);
elementNamespace = '.' + id; elementNamespace = '.' + id;
} }
}, },
@ -730,9 +730,6 @@ $.fn.sidebar = function(parameters) {
return transitions[transition]; return transitions[transition];
} }
} }
},
uniqueID: function() {
return (Math.random().toString(16) + '000000000').substr(2,8);
} }
}, },

Loading…
Cancel
Save