فهرست منبع

remove final jq from tests

Adam Shaw 7 سال پیش
والد
کامیت
076e0b22a2
2فایلهای تغییر یافته به همراه0 افزوده شده و 52 حذف شده
  1. 0 7
      tests/automated/hacks.js
  2. 0 45
      tests/automated/lib/fullcalendar-jquery-plugin.js

+ 0 - 7
tests/automated/hacks.js

@@ -13,10 +13,3 @@ beforeEach(function() {
   jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000
   jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000
 
 
 })
 })
-
-
-// Destroy all calendars afterwards, to prevent memory leaks
-// (not the best place for this)
-afterEach(function() {
-  $('.fc').fullCalendar('destroy')
-})

+ 0 - 45
tests/automated/lib/fullcalendar-jquery-plugin.js

@@ -1,45 +0,0 @@
-
-$.fn.fullCalendar = function(options) {
-  let args = Array.prototype.slice.call(arguments, 1) // for a possible method call
-  let res = this // what this function will return (this jQuery object by default)
-
-  this.each(function(i, el) { // loop each DOM element involved
-    let $el = $(el)
-    let calendar = $el.data('fullCalendar') // get the existing calendar object (if any)
-    let singleRes // the returned value of this single method call
-
-    // a method call
-    if (typeof options === 'string') {
-
-      if (options === 'getCalendar') {
-        if (!i) { // first element only
-          res = calendar
-        }
-      } else if (options === 'destroy') { // don't warn if no calendar object
-        if (calendar) {
-          calendar.destroy()
-          $el.removeData('fullCalendar')
-        }
-      } else if (!calendar) {
-        FullCalendar.warn('Attempting to call a FullCalendar method on an element with no calendar.')
-      } else if (typeof calendar[options] === 'function') {
-        singleRes = calendar[options].apply(calendar, args)
-
-        if (!i) {
-          res = singleRes // record the first method call result
-        }
-        if (options === 'destroy') { // for the destroy method, must remove Calendar object data
-          $el.removeData('fullCalendar')
-        }
-      } else {
-        FullCalendar.warn("'" + options + "' is an unknown FullCalendar method.")
-      }
-    } else if (!calendar) { // don't initialize twice
-      calendar = new FullCalendar.Calendar(el, options)
-      $el.data('fullCalendar', calendar)
-      calendar.render()
-    }
-  })
-
-  return res
-}